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