test_class.file: descriptor/qsarmolecular/src/test/java/org/openscience/cdk/qsar/descriptors/molecular/CarbonTypesDescriptorTest.java
test_class.identifier: CarbonTypesDescriptorTest
test_class.superclass: extends MolecularDescriptorTest
test_case.body: @Test
      public void testComplex1() throws Exception {
          SmilesParser sp = new SmilesParser(DefaultChemObjectBuilder.getInstance());
          IAtomContainer mol = sp.parseSmiles("C(C)(C)C=C(C)C");
  
          IntegerArrayResult ret = (IntegerArrayResult) descriptor.calculate(mol).getValue();
  
          Assert.assertEquals(0, ret.get(0));
          Assert.assertEquals(0, ret.get(1));
          Assert.assertEquals(0, ret.get(2));
          Assert.assertEquals(1, ret.get(3));
          Assert.assertEquals(1, ret.get(4));
          Assert.assertEquals(4, ret.get(5));
          Assert.assertEquals(0, ret.get(6));
          Assert.assertEquals(1, ret.get(7));
          Assert.assertEquals(0, ret.get(8));
      }
test_case.class_method_signature: CarbonTypesDescriptorTest.testComplex1()
test_case.full_signature: @Test public void testComplex1()
test_case.identifier: testComplex1
test_case.invocations: getInstance parseSmiles getValue calculate assertEquals get assertEquals get assertEquals get assertEquals get assertEquals get assertEquals get assertEquals get assertEquals get assertEquals get
test_case.modifiers: @Test public
test_case.parameters: ()
test_case.return: void
test_case.signature: void testComplex1()
focal_class.declarator: NAMES = {"C1SP1", "C2SP1", "C1SP2", "C2SP2", "C3SP2", "C1SP3", "C2SP3", "C3SP3",
              "C4SP3"                     }
focal_class.modifier: private final static
focal_class.original_string: private final static String[] NAMES = {"C1SP1", "C2SP1", "C1SP2", "C2SP2", "C3SP2", "C1SP3", "C2SP3", "C3SP3",
              "C4SP3"                     };
focal_class.type: String[]
focal_class.var_name: NAMES
focal_class.file: descriptor/qsarmolecular/src/main/java/org/openscience/cdk/qsar/descriptors/molecular/CarbonTypesDescriptor.java
focal_class.identifier: CarbonTypesDescriptor
focal_class.interfaces: implements IMolecularDescriptor
focal_class.class_method_signature: CarbonTypesDescriptor.CarbonTypesDescriptor()
focal_class.full_signature: public  CarbonTypesDescriptor()
focal_class.identifier: CarbonTypesDescriptor
focal_class.modifiers: public
focal_class.parameters: ()
focal_class.signature:  CarbonTypesDescriptor()
focal_class.class_method_signature: CarbonTypesDescriptor.getSpecification()
focal_class.full_signature: @Override public DescriptorSpecification getSpecification()
focal_class.identifier: getSpecification
focal_class.modifiers: @Override public
focal_class.parameters: ()
focal_class.return: DescriptorSpecification
focal_class.signature: DescriptorSpecification getSpecification()
focal_class.class_method_signature: CarbonTypesDescriptor.setParameters(Object[] params)
focal_class.full_signature: @Override public void setParameters(Object[] params)
focal_class.identifier: setParameters
focal_class.modifiers: @Override public
focal_class.parameters: (Object[] params)
focal_class.return: void
focal_class.signature: void setParameters(Object[] params)
focal_class.class_method_signature: CarbonTypesDescriptor.getParameters()
focal_class.full_signature: @Override public Object[] getParameters()
focal_class.identifier: getParameters
focal_class.modifiers: @Override public
focal_class.parameters: ()
focal_class.return: Object[]
focal_class.signature: Object[] getParameters()
focal_class.class_method_signature: CarbonTypesDescriptor.getDescriptorNames()
focal_class.full_signature: @Override public String[] getDescriptorNames()
focal_class.identifier: getDescriptorNames
focal_class.modifiers: @Override public
focal_class.parameters: ()
focal_class.return: String[]
focal_class.signature: String[] getDescriptorNames()
focal_class.class_method_signature: CarbonTypesDescriptor.getParameterNames()
focal_class.full_signature: @Override public String[] getParameterNames()
focal_class.identifier: getParameterNames
focal_class.modifiers: @Override public
focal_class.parameters: ()
focal_class.return: String[]
focal_class.signature: String[] getParameterNames()
focal_class.class_method_signature: CarbonTypesDescriptor.getParameterType(String name)
focal_class.full_signature: @Override public Object getParameterType(String name)
focal_class.identifier: getParameterType
focal_class.modifiers: @Override public
focal_class.parameters: (String name)
focal_class.return: Object
focal_class.signature: Object getParameterType(String name)
focal_class.class_method_signature: CarbonTypesDescriptor.calculate(IAtomContainer container)
focal_class.full_signature: @Override public DescriptorValue calculate(IAtomContainer container)
focal_class.identifier: calculate
focal_class.modifiers: @Override public
focal_class.parameters: (IAtomContainer container)
focal_class.return: DescriptorValue
focal_class.signature: DescriptorValue calculate(IAtomContainer container)
focal_class.class_method_signature: CarbonTypesDescriptor.getHighestBondOrder(IAtomContainer container, IAtom atom)
focal_class.full_signature: private IBond.Order getHighestBondOrder(IAtomContainer container, IAtom atom)
focal_class.identifier: getHighestBondOrder
focal_class.modifiers: private
focal_class.parameters: (IAtomContainer container, IAtom atom)
focal_class.return: IBond.Order
focal_class.signature: IBond.Order getHighestBondOrder(IAtomContainer container, IAtom atom)
focal_class.class_method_signature: CarbonTypesDescriptor.getDescriptorResultType()
focal_class.full_signature: @Override public IDescriptorResult getDescriptorResultType()
focal_class.identifier: getDescriptorResultType
focal_class.modifiers: @Override public
focal_class.parameters: ()
focal_class.return: IDescriptorResult
focal_class.signature: IDescriptorResult getDescriptorResultType()
focal_class.superclass: extends AbstractMolecularDescriptor
focal_method.body: @Override
      public DescriptorValue calculate(IAtomContainer container) {
          int c1sp1 = 0;
          int c2sp1 = 0;
          int c1sp2 = 0;
          int c2sp2 = 0;
          int c3sp2 = 0;
          int c1sp3 = 0;
          int c2sp3 = 0;
          int c3sp3 = 0;
          int c4sp3 = 0;
  
          for (IAtom atom : container.atoms()) {
              if (atom.getAtomicNumber() != IElement.C) continue;
              List<IAtom> connectedAtoms = container.getConnectedAtomsList(atom);
  
              int cc = 0;
              for (IAtom connectedAtom : connectedAtoms) {
                  if (connectedAtom.getAtomicNumber() == IElement.C) cc++;
              }
  
              IBond.Order maxBondOrder = getHighestBondOrder(container, atom);
  
              if (maxBondOrder == IBond.Order.TRIPLE && cc == 1)
                  c1sp1++;
              else if (maxBondOrder == IBond.Order.TRIPLE && cc == 2)
                  c2sp1++;
              else if (maxBondOrder == IBond.Order.DOUBLE && cc == 1)
                  c1sp2++;
              else if (maxBondOrder == IBond.Order.DOUBLE && cc == 2)
                  c2sp2++;
              else if (maxBondOrder == IBond.Order.DOUBLE && cc == 3)
                  c3sp2++;
              else if (maxBondOrder == IBond.Order.SINGLE && cc == 1)
                  c1sp3++;
              else if (maxBondOrder == IBond.Order.SINGLE && cc == 2)
                  c2sp3++;
              else if (maxBondOrder == IBond.Order.SINGLE && cc == 3)
                  c3sp3++;
              else if (maxBondOrder == IBond.Order.SINGLE && cc == 4) c4sp3++;
          }
  
          IntegerArrayResult retval = new IntegerArrayResult(9);
          retval.add(c1sp1);
          retval.add(c2sp1);
          retval.add(c1sp2);
          retval.add(c2sp2);
          retval.add(c3sp2);
          retval.add(c1sp3);
          retval.add(c2sp3);
          retval.add(c3sp3);
          retval.add(c4sp3);
  
          return new DescriptorValue(getSpecification(), getParameterNames(), getParameters(), retval,
                  getDescriptorNames());
      }
focal_method.class_method_signature: CarbonTypesDescriptor.calculate(IAtomContainer container)
focal_method.full_signature: @Override public DescriptorValue calculate(IAtomContainer container)
focal_method.identifier: calculate
focal_method.invocations: atoms getAtomicNumber getConnectedAtomsList getAtomicNumber getHighestBondOrder add add add add add add add add add getSpecification getParameterNames getParameters getDescriptorNames
focal_method.modifiers: @Override public
focal_method.parameters: (IAtomContainer container)
focal_method.return: DescriptorValue
focal_method.signature: DescriptorValue calculate(IAtomContainer container)