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.declarator: molecule
test_class.modifier: static
test_class.original_string: static IAtomContainer molecule;
test_class.type: IAtomContainer
test_class.var_name: molecule
test_class.declarator: ligands
test_class.modifier: static
test_class.original_string: static ILigand[]      ligands;
test_class.type: ILigand[]
test_class.var_name: ligands
test_class.file: descriptor/cip/src/test/java/org/openscience/cdk/geometry/cip/CIPToolTest.java
test_class.identifier: CIPToolTest
test_class.superclass: extends CDKTestCase
test_case.body: @Test
      public void testGetLigandLigands() throws Exception {
          IAtomContainer molecule = smiles.parseSmiles("CC(C)C(CC)(C(C)(C)C)[H]");
          ILigand ligand = CIPTool.defineLigand(molecule, new VisitedAtoms(), 3, 1);
          ILigand[] sideChains = CIPTool.getLigandLigands(ligand);
          Assert.assertEquals(2, sideChains.length);
          ligand = CIPTool.defineLigand(molecule, new VisitedAtoms(), 3, 4);
          sideChains = CIPTool.getLigandLigands(ligand);
          Assert.assertEquals(1, sideChains.length);
          ligand = CIPTool.defineLigand(molecule, new VisitedAtoms(), 3, 6);
          sideChains = CIPTool.getLigandLigands(ligand);
          Assert.assertEquals(3, sideChains.length);
          ligand = CIPTool.defineLigand(molecule, new VisitedAtoms(), 3, 10);
          sideChains = CIPTool.getLigandLigands(ligand);
          Assert.assertEquals(0, sideChains.length);
      }
test_case.class_method_signature: CIPToolTest.testGetLigandLigands()
test_case.full_signature: @Test public void testGetLigandLigands()
test_case.identifier: testGetLigandLigands
test_case.invocations: parseSmiles defineLigand getLigandLigands assertEquals defineLigand getLigandLigands assertEquals defineLigand getLigandLigands assertEquals defineLigand getLigandLigands assertEquals
test_case.modifiers: @Test public
test_case.parameters: ()
test_case.return: void
test_case.signature: void testGetLigandLigands()
focal_class.declarator: HYDROGEN = -1
focal_class.modifier: public static final
focal_class.original_string: public static final int      HYDROGEN = -1;
focal_class.type: int
focal_class.var_name: HYDROGEN
focal_class.declarator: cipRule  = new CIPLigandRule()
focal_class.modifier: private static
focal_class.original_string: private static CIPLigandRule cipRule  = new CIPLigandRule();
focal_class.type: CIPLigandRule
focal_class.var_name: cipRule
focal_class.file: descriptor/cip/src/main/java/org/openscience/cdk/geometry/cip/CIPTool.java
focal_class.identifier: CIPTool
focal_class.class_method_signature: CIPTool.getCIPChirality(LigancyFourChirality stereoCenter)
focal_class.full_signature: public static CIP_CHIRALITY getCIPChirality(LigancyFourChirality stereoCenter)
focal_class.identifier: getCIPChirality
focal_class.modifiers: public static
focal_class.parameters: (LigancyFourChirality stereoCenter)
focal_class.return: CIP_CHIRALITY
focal_class.signature: CIP_CHIRALITY getCIPChirality(LigancyFourChirality stereoCenter)
focal_class.class_method_signature: CIPTool.label(IAtomContainer container)
focal_class.full_signature: public static void label(IAtomContainer container)
focal_class.identifier: label
focal_class.modifiers: public static
focal_class.parameters: (IAtomContainer container)
focal_class.return: void
focal_class.signature: void label(IAtomContainer container)
focal_class.class_method_signature: CIPTool.getCIPChirality(IAtomContainer container, ITetrahedralChirality stereoCenter)
focal_class.full_signature: public static CIP_CHIRALITY getCIPChirality(IAtomContainer container, ITetrahedralChirality stereoCenter)
focal_class.identifier: getCIPChirality
focal_class.modifiers: public static
focal_class.parameters: (IAtomContainer container, ITetrahedralChirality stereoCenter)
focal_class.return: CIP_CHIRALITY
focal_class.signature: CIP_CHIRALITY getCIPChirality(IAtomContainer container, ITetrahedralChirality stereoCenter)
focal_class.class_method_signature: CIPTool.getCIPChirality(IAtomContainer container, IDoubleBondStereochemistry stereoCenter)
focal_class.full_signature: public static CIP_CHIRALITY getCIPChirality(IAtomContainer container, IDoubleBondStereochemistry stereoCenter)
focal_class.identifier: getCIPChirality
focal_class.modifiers: public static
focal_class.parameters: (IAtomContainer container, IDoubleBondStereochemistry stereoCenter)
focal_class.return: CIP_CHIRALITY
focal_class.signature: CIP_CHIRALITY getCIPChirality(IAtomContainer container, IDoubleBondStereochemistry stereoCenter)
focal_class.class_method_signature: CIPTool.getLigands(IAtom atom, IAtomContainer container, IAtom exclude)
focal_class.full_signature: private static ILigand[] getLigands(IAtom atom, IAtomContainer container, IAtom exclude)
focal_class.identifier: getLigands
focal_class.modifiers: private static
focal_class.parameters: (IAtom atom, IAtomContainer container, IAtom exclude)
focal_class.return: ILigand[]
focal_class.signature: ILigand[] getLigands(IAtom atom, IAtomContainer container, IAtom exclude)
focal_class.class_method_signature: CIPTool.checkIfAllLigandsAreDifferent(ILigand[] ligands)
focal_class.full_signature: public static boolean checkIfAllLigandsAreDifferent(ILigand[] ligands)
focal_class.identifier: checkIfAllLigandsAreDifferent
focal_class.modifiers: public static
focal_class.parameters: (ILigand[] ligands)
focal_class.return: boolean
focal_class.signature: boolean checkIfAllLigandsAreDifferent(ILigand[] ligands)
focal_class.class_method_signature: CIPTool.order(ILigand[] ligands)
focal_class.full_signature: public static ILigand[] order(ILigand[] ligands)
focal_class.identifier: order
focal_class.modifiers: public static
focal_class.parameters: (ILigand[] ligands)
focal_class.return: ILigand[]
focal_class.signature: ILigand[] order(ILigand[] ligands)
focal_class.class_method_signature: CIPTool.permParity(final ILigand[] ligands)
focal_class.full_signature: private static int permParity(final ILigand[] ligands)
focal_class.identifier: permParity
focal_class.modifiers: private static
focal_class.parameters: (final ILigand[] ligands)
focal_class.return: int
focal_class.signature: int permParity(final ILigand[] ligands)
focal_class.class_method_signature: CIPTool.defineLigancyFourChirality(IAtomContainer container, int chiralAtom,
              int ligand1, int ligand2, int ligand3, int ligand4, Stereo stereo)
focal_class.full_signature: public static LigancyFourChirality defineLigancyFourChirality(IAtomContainer container, int chiralAtom,
              int ligand1, int ligand2, int ligand3, int ligand4, Stereo stereo)
focal_class.identifier: defineLigancyFourChirality
focal_class.modifiers: public static
focal_class.parameters: (IAtomContainer container, int chiralAtom,
              int ligand1, int ligand2, int ligand3, int ligand4, Stereo stereo)
focal_class.return: LigancyFourChirality
focal_class.signature: LigancyFourChirality defineLigancyFourChirality(IAtomContainer container, int chiralAtom,
              int ligand1, int ligand2, int ligand3, int ligand4, Stereo stereo)
focal_class.class_method_signature: CIPTool.defineLigand(IAtomContainer container, VisitedAtoms visitedAtoms, int chiralAtom,
              int ligandAtom)
focal_class.full_signature: public static ILigand defineLigand(IAtomContainer container, VisitedAtoms visitedAtoms, int chiralAtom,
              int ligandAtom)
focal_class.identifier: defineLigand
focal_class.modifiers: public static
focal_class.parameters: (IAtomContainer container, VisitedAtoms visitedAtoms, int chiralAtom,
              int ligandAtom)
focal_class.return: ILigand
focal_class.signature: ILigand defineLigand(IAtomContainer container, VisitedAtoms visitedAtoms, int chiralAtom,
              int ligandAtom)
focal_class.class_method_signature: CIPTool.getLigandLigands(ILigand ligand)
focal_class.full_signature: public static ILigand[] getLigandLigands(ILigand ligand)
focal_class.identifier: getLigandLigands
focal_class.modifiers: public static
focal_class.parameters: (ILigand ligand)
focal_class.return: ILigand[]
focal_class.signature: ILigand[] getLigandLigands(ILigand ligand)
focal_class.class_method_signature: CIPTool.getDuplication(Order order)
focal_class.full_signature: private static int getDuplication(Order order)
focal_class.identifier: getDuplication
focal_class.modifiers: private static
focal_class.parameters: (Order order)
focal_class.return: int
focal_class.signature: int getDuplication(Order order)
focal_method.body: public static ILigand[] getLigandLigands(ILigand ligand) {
          if (ligand instanceof TerminalLigand) return new ILigand[0];
  
          IAtomContainer container = ligand.getAtomContainer();
          IAtom ligandAtom = ligand.getLigandAtom();
          IAtom centralAtom = ligand.getCentralAtom();
          VisitedAtoms visitedAtoms = ligand.getVisitedAtoms();
          List<IBond> bonds = container.getConnectedBondsList(ligandAtom);
          // duplicate ligands according to bond order, following the CIP rules
          List<ILigand> ligands = new ArrayList<ILigand>();
          for (IBond bond : bonds) {
              if (bond.contains(centralAtom)) {
                  if (Order.SINGLE == bond.getOrder()) continue;
                  int duplication = getDuplication(bond.getOrder()) - 1;
                  if (duplication > 0) {
                      for (int i = 1; i <= duplication; i++) {
                          ligands.add(new TerminalLigand(container, visitedAtoms, ligandAtom, centralAtom));
                      }
                  }
              } else {
                  int duplication = getDuplication(bond.getOrder());
                  IAtom connectedAtom = bond.getOther(ligandAtom);
                  if (visitedAtoms.isVisited(connectedAtom)) {
                      ligands.add(new TerminalLigand(container, visitedAtoms, ligandAtom, connectedAtom));
                  } else {
                      ligands.add(new Ligand(container, visitedAtoms, ligandAtom, connectedAtom));
                  }
                  for (int i = 2; i <= duplication; i++) {
                      ligands.add(new TerminalLigand(container, visitedAtoms, ligandAtom, connectedAtom));
                  }
              }
          }
          return ligands.toArray(new ILigand[0]);
      }
focal_method.class_method_signature: CIPTool.getLigandLigands(ILigand ligand)
focal_method.full_signature: public static ILigand[] getLigandLigands(ILigand ligand)
focal_method.identifier: getLigandLigands
focal_method.invocations: getAtomContainer getLigandAtom getCentralAtom getVisitedAtoms getConnectedBondsList contains getOrder getDuplication getOrder add getDuplication getOrder getOther isVisited add add add toArray
focal_method.modifiers: public static
focal_method.parameters: (ILigand ligand)
focal_method.return: ILigand[]
focal_method.signature: ILigand[] getLigandLigands(ILigand ligand)