List of usage examples for java.util Vector Vector
public Vector()
From source file:Main.java
public static Vector<String> getNegativeAssociation(String word) { Vector<String> result = new Vector<String>(); result.add(word);//from ww w . j a v a2s. c o m try { result.addAll(negMap.get(word)); } catch (Exception e) { } return result; }
From source file:Main.java
public static Vector<Element> getChildElemsByName(final String name, final Node parent) { Vector<Element> v = new Vector<Element>(); Element elem = null;//from w ww. ja v a 2s.c om for (Node childNode = parent.getFirstChild(); childNode != null; childNode = childNode.getNextSibling()) { if (childNode.getNodeType() == Node.ELEMENT_NODE) { if (childNode.getNodeName() == name) { elem = (Element) childNode; v.add(elem); } } } return v; }
From source file:Main.java
public static Vector getChildrenElementsByTag(Node node, String name) { Vector result = new Vector(); NodeList nl = node.getChildNodes(); for (int i = 0; i < nl.getLength(); i++) if (nl.item(i) instanceof Element && (((Element) nl.item(i)).getTagName().equals(name) || name == null)) { result.add(nl.item(i));/*w w w . j a v a2 s . c om*/ //System.out.println(nl.item(i).toString()); //System.out.println(((Element)nl.item(i)).getAttribute("className")); //System.out.println(((Element)nl.item(i)).getTagName()); } return result; }
From source file:Main.java
@SuppressWarnings("unchecked") public final static Vector subElementList(Element superEle, String subName) { Vector v = new Vector(); NodeList list = superEle.getChildNodes(); if (list == null) { return null; }//from ww w .j av a2 s . c o m for (int i = 0; i < list.getLength(); i++) { Node node = list.item(i); if (node.getNodeType() == Node.ELEMENT_NODE) { if (node.getNodeName().equals(subName)) { v.add(node); } } } return v; }
From source file:Main.java
public static synchronized String[] getElementValues(Element element) { if (element == null) { return null; }/* w w w. j a va 2 s .c om*/ Vector childs = new Vector(); for (Node node = element.getFirstChild(); node != null; node = node.getNextSibling()) { if (node instanceof Text) { childs.add(node.getNodeValue()); } } String[] values = new String[childs.size()]; childs.toArray(values); return values; }
From source file:Main.java
/** * Get a list of all look and feels avaliable * //from ww w .j ava2 s. c o m * @return */ public static List<String> getAllLookAndFeels() { List<String> lnf = new Vector<>(); for (LookAndFeelInfo l : UIManager.getInstalledLookAndFeels()) { lnf.add(l.getName()); } return lnf; }
From source file:Main.java
private static List<String> getAllPermutations(String base, String toPermute) { List<String> permutations = new Vector<String>(); if (toPermute.length() == 1) { permutations.add(base + toPermute); return permutations; }//from w w w. j av a 2 s. c om //permuatations for (int i = 0; i < toPermute.length(); i++) { char a = toPermute.charAt(i); StringBuffer stillToPermute = (new StringBuffer(toPermute)).delete(i, i + 1); List<String> smallerPermuatations = getAllPermutations(base + a, new String(stillToPermute)); permutations.addAll(smallerPermuatations); } return permutations; }
From source file:Main.java
private static Vector<String> getConditionsOperatorTokens(String relevant) { //TODO For now we are only dealing with one AND or OR, for simplicity //If one mixes both in the same relevant statement, then we take the first. Vector<String> list = new Vector<String>(); int pos = 0;/*from w w w. j a va 2 s . c o m*/ do { pos = extractConditionsOperatorTokens(relevant, pos, list); } while (pos > 0); return list; }
From source file:Main.java
public static Vector arrayToVector(Object[][] list) { // Convert into a vector of vectors Vector v = new Vector(); Vector subVector = null;/*from ww w. jav a2s .c o m*/ for (int i = 0; i < list.length; i++) { subVector = new Vector(); for (int j = 0; j < list[i].length; j++) { subVector.add(list[i][j]); } v.add(subVector); } return (v); }
From source file:Main.java
public static <GPType> List<GPType> asList(final GPType node1, final GPType node2) { final List<GPType> list = new Vector<GPType>(); list.add(node1);/*from w ww . j av a 2 s. c om*/ list.add(node2); return list; }