Example #1
0
 // ## operation generateReverse(ReactionAdjList)
 public StructureTemplate generateReverse(ReactionAdjList p_reactionAdjList) {
   // #[ operation generateReverse(ReactionAdjList)
   int r_num = getReactantNumber();
   Matchable r1 = getAllowedFunctionalGroupAt(1);
   LinkedList reactant = new LinkedList();
   reactant.add(r1);
   if (r_num == 2) {
     Matchable r2 = getAllowedFunctionalGroupAt(2);
     reactant.add(r2);
   }
   LinkedList reverse = p_reactionAdjList.reactFunctionalGroup(reactant);
   StructureTemplate reverseRT = new StructureTemplate(reverse);
   reverseRT.reactantTree = this.reactantTree;
   return reverseRT;
   // #]
 }