test_class.declarator: smiles = new SmilesParser(SilentChemObjectBuilder.getInstance())
test_class.modifier: static
test_class.original_string: static SmilesParser smiles = new SmilesParser(SilentChemObjectBuilder.getInstance());
test_class.type: SmilesParser
test_class.var_name: smiles
test_class.file: descriptor/cip/src/test/java/org/openscience/cdk/geometry/cip/rules/CIPLigandRuleTest.java
test_class.identifier: CIPLigandRuleTest
test_class.superclass: extends CDKTestCase
test_case.body: @Test
      public void testOrder() throws Exception {
          IAtomContainer molecule = smiles.parseSmiles("CC(Br)([13C])[H]");
          List<ILigand> ligands = new ArrayList<ILigand>();
          VisitedAtoms visitedAtoms = new VisitedAtoms();
          ligands.add(CIPTool.defineLigand(molecule, visitedAtoms, 1, 4));
          ligands.add(CIPTool.defineLigand(molecule, visitedAtoms, 1, 3));
          ligands.add(CIPTool.defineLigand(molecule, visitedAtoms, 1, 2));
          ligands.add(CIPTool.defineLigand(molecule, visitedAtoms, 1, 0));
  
          Collections.sort(ligands, new CIPLigandRule());
          Assert.assertEquals("H", ligands.get(0).getLigandAtom().getSymbol());
          Assert.assertEquals("C", ligands.get(1).getLigandAtom().getSymbol());
          Assert.assertEquals("C", ligands.get(2).getLigandAtom().getSymbol());
          Assert.assertEquals(13, ligands.get(2).getLigandAtom().getMassNumber().intValue());
          Assert.assertEquals("Br", ligands.get(3).getLigandAtom().getSymbol());
      }
test_case.class_method_signature: CIPLigandRuleTest.testOrder()
test_case.full_signature: @Test public void testOrder()
test_case.identifier: testOrder
test_case.invocations: parseSmiles add defineLigand add defineLigand add defineLigand add defineLigand sort assertEquals getSymbol getLigandAtom get assertEquals getSymbol getLigandAtom get assertEquals getSymbol getLigandAtom get assertEquals intValue getMassNumber getLigandAtom get assertEquals getSymbol getLigandAtom get
test_case.modifiers: @Test public
test_case.parameters: ()
test_case.return: void
test_case.signature: void testOrder()
focal_class.declarator: numberRule = new CombinedAtomicMassNumberRule()
focal_class.original_string: CombinedAtomicMassNumberRule numberRule = new CombinedAtomicMassNumberRule();
focal_class.type: CombinedAtomicMassNumberRule
focal_class.var_name: numberRule
focal_class.file: descriptor/cip/src/main/java/org/openscience/cdk/geometry/cip/rules/CIPLigandRule.java
focal_class.identifier: CIPLigandRule
focal_class.interfaces: implements ISequenceSubRule<ILigand>
focal_class.class_method_signature: CIPLigandRule.compare(ILigand ligand1, ILigand ligand2)
focal_class.full_signature: @Override public int compare(ILigand ligand1, ILigand ligand2)
focal_class.identifier: compare
focal_class.modifiers: @Override public
focal_class.parameters: (ILigand ligand1, ILigand ligand2)
focal_class.return: int
focal_class.signature: int compare(ILigand ligand1, ILigand ligand2)
focal_class.class_method_signature: CIPLigandRule.order(ILigand[] ligands)
focal_class.full_signature: private ILigand[] order(ILigand[] ligands)
focal_class.identifier: order
focal_class.modifiers: private
focal_class.parameters: (ILigand[] ligands)
focal_class.return: ILigand[]
focal_class.signature: ILigand[] order(ILigand[] ligands)
focal_method.body: private ILigand[] order(ILigand[] ligands) {
          ILigand[] newLigands = new ILigand[ligands.length];
          System.arraycopy(ligands, 0, newLigands, 0, ligands.length);
  
          Arrays.sort(newLigands, numberRule);
          // this above list is from low to high precendence, so we need to revert the array
          ILigand[] reverseLigands = new ILigand[newLigands.length];
          for (int i = 0; i < newLigands.length; i++) {
              reverseLigands[(newLigands.length - 1) - i] = newLigands[i];
          }
          return reverseLigands;
      }
focal_method.class_method_signature: CIPLigandRule.order(ILigand[] ligands)
focal_method.full_signature: private ILigand[] order(ILigand[] ligands)
focal_method.identifier: order
focal_method.invocations: arraycopy sort
focal_method.modifiers: private
focal_method.parameters: (ILigand[] ligands)
focal_method.return: ILigand[]
focal_method.signature: ILigand[] order(ILigand[] ligands)