Exemplo n.º 1
0
 // ## operation getMatchedFunctionalGroup(LinkedList)
 public LinkedList getMatchedFunctionalGroup(LinkedList p_reactants) {
   // #[ operation getMatchedFunctionalGroup(LinkedList)
   LinkedList fgCollection = new LinkedList();
   boolean found = false;
   Iterator r_iter = p_reactants.iterator();
   while (r_iter.hasNext()) {
     found = false;
     Object o = r_iter.next();
     ChemGraph cg = null;
     if (o instanceof Species) cg = ((Species) r_iter.next()).getChemGraph();
     else cg = (ChemGraph) o;
     Iterator t_iter = reactantTree.iterator();
     while (t_iter.hasNext()) {
       HierarchyTree t = (HierarchyTree) t_iter.next();
       Stack s = t.findMatchedPath(cg);
       if (s != null && !s.isEmpty()) {
         found = true;
         fgCollection.add(s);
       }
     }
     if (!found) {
       // System.out.println("can't find matched path: " + cg.toString());
       // System.exit(0);
       return null;
     }
   }
   return fgCollection;
   // #]
 }
Exemplo n.º 2
0
 public void clearReactantTree() {
   reactantTree.clear();
 }
Exemplo n.º 3
0
 public void removeReactantTree(HierarchyTree p_HierarchyTree) {
   reactantTree.remove(p_HierarchyTree);
 }
Exemplo n.º 4
0
 public void addReactantTree(HierarchyTree p_HierarchyTree) {
   reactantTree.add(p_HierarchyTree);
 }
Exemplo n.º 5
0
 public ListIterator getReactantTree() {
   ListIterator iter = reactantTree.listIterator();
   return iter;
 }
Exemplo n.º 6
0
 // ## operation getReactantTreeNumber()
 public int getReactantTreeNumber() {
   // #[ operation getReactantTreeNumber()
   return reactantTree.size();
   // #]
 }