예제 #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;
   // #]
 }
예제 #2
0
 public void clearReactantTree() {
   reactantTree.clear();
 }
예제 #3
0
 public void removeReactantTree(HierarchyTree p_HierarchyTree) {
   reactantTree.remove(p_HierarchyTree);
 }
예제 #4
0
 public void addReactantTree(HierarchyTree p_HierarchyTree) {
   reactantTree.add(p_HierarchyTree);
 }
예제 #5
0
 public ListIterator getReactantTree() {
   ListIterator iter = reactantTree.listIterator();
   return iter;
 }
예제 #6
0
 // ## operation getReactantTreeNumber()
 public int getReactantTreeNumber() {
   // #[ operation getReactantTreeNumber()
   return reactantTree.size();
   // #]
 }