Example #1
0
 private Vector getChildren(Keyword keyword, Vector allKids) {
   allKids.addElement(keyword);
   // 			System.out.println("Addtoallkids " + keyword + "  " + allKids );
   Vector children = keyword.getChildren();
   if (children != null) {
     Iterator i = children.iterator();
     while (i.hasNext()) {
       Keyword child = (Keyword) i.next();
       getChildren(child, allKids);
     }
   }
   return allKids;
 }
Example #2
0
  private void addKeyword(Hashtable table, Keyword word, Keyword parent) {
    boolean recurse = true;

    if (table.containsKey(word)) recurse = false;

    if (parent == null) table.put(word, String.valueOf(-1));
    else table.put(word, parent);

    if (recurse) {
      Iterator it = word.getChildren().iterator();
      while (it.hasNext()) {
        addKeyword(table, (Keyword) it.next(), word);
      }
    }
  }