test_class.file: descriptor/qsarmolecular/src/test/java/org/openscience/cdk/qsar/descriptors/molecular/AromaticBondsCountDescriptorTest.java
test_class.identifier: AromaticBondsCountDescriptorTest
test_class.superclass: extends MolecularDescriptorTest
test_case.body: @Test
      public void testViaFlags() throws Exception {
          IAtomContainer molecule = TestMoleculeFactory.makeBenzene();
          for (Iterator bonds = molecule.bonds().iterator(); bonds.hasNext();) {
              ((IBond) bonds.next()).setFlag(CDKConstants.ISAROMATIC, true);
          }
          Assert.assertEquals(6, ((IntegerResult) descriptor.calculate(molecule).getValue()).intValue());
      }
test_case.class_method_signature: AromaticBondsCountDescriptorTest.testViaFlags()
test_case.full_signature: @Test public void testViaFlags()
test_case.identifier: testViaFlags
test_case.invocations: makeBenzene iterator bonds hasNext setFlag next assertEquals intValue getValue calculate
test_case.modifiers: @Test public
test_case.parameters: ()
test_case.return: void
test_case.signature: void testViaFlags()
focal_class.declarator: checkAromaticity = false
focal_class.modifier: private
focal_class.original_string: private boolean               checkAromaticity = false;
focal_class.type: boolean
focal_class.var_name: checkAromaticity
focal_class.declarator: NAMES            = {"nAromBond"}
focal_class.modifier: private static final
focal_class.original_string: private static final String[] NAMES            = {"nAromBond"};
focal_class.type: String[]
focal_class.var_name: NAMES
focal_class.file: descriptor/qsarmolecular/src/main/java/org/openscience/cdk/qsar/descriptors/molecular/AromaticBondsCountDescriptor.java
focal_class.identifier: AromaticBondsCountDescriptor
focal_class.interfaces: implements IMolecularDescriptor
focal_class.class_method_signature: AromaticBondsCountDescriptor.AromaticBondsCountDescriptor()
focal_class.full_signature: public  AromaticBondsCountDescriptor()
focal_class.identifier: AromaticBondsCountDescriptor
focal_class.modifiers: public
focal_class.parameters: ()
focal_class.signature:  AromaticBondsCountDescriptor()
focal_class.class_method_signature: AromaticBondsCountDescriptor.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: AromaticBondsCountDescriptor.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: AromaticBondsCountDescriptor.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: AromaticBondsCountDescriptor.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: AromaticBondsCountDescriptor.calculate(IAtomContainer atomContainer)
focal_class.full_signature: @Override public DescriptorValue calculate(IAtomContainer atomContainer)
focal_class.identifier: calculate
focal_class.modifiers: @Override public
focal_class.parameters: (IAtomContainer atomContainer)
focal_class.return: DescriptorValue
focal_class.signature: DescriptorValue calculate(IAtomContainer atomContainer)
focal_class.class_method_signature: AromaticBondsCountDescriptor.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.class_method_signature: AromaticBondsCountDescriptor.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: AromaticBondsCountDescriptor.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.superclass: extends AbstractMolecularDescriptor
focal_method.body: @Override
      public DescriptorValue calculate(IAtomContainer atomContainer) {
          IAtomContainer ac;
          try {
              ac = (IAtomContainer) atomContainer.clone();
          } catch (CloneNotSupportedException e) {
              return new DescriptorValue(getSpecification(), getParameterNames(), getParameters(), new IntegerResult(
                      (int) Double.NaN), getDescriptorNames(), new CDKException("Error during clone"));
          }
  
          int aromaticBondsCount = 0;
          if (checkAromaticity) {
              try {
                  AtomContainerManipulator.percieveAtomTypesAndConfigureAtoms(ac);
              } catch (CDKException e) {
                  return new DescriptorValue(getSpecification(), getParameterNames(), getParameters(), new IntegerResult(
                          (int) Double.NaN), getDescriptorNames(), new CDKException("Error during atom type perception"));
              }
              try {
                  Aromaticity.cdkLegacy().apply(ac);
              } catch (CDKException e) {
                  return new DescriptorValue(getSpecification(), getParameterNames(), getParameters(), new IntegerResult(
                          (int) Double.NaN), getDescriptorNames(), new CDKException(
                          "Error during aromaticity detection: " + e.getMessage()));
              }
          }
          Iterator bonds = ac.bonds().iterator();
          while (bonds.hasNext()) {
              IBond bond = (IBond) bonds.next();
              if (bond.getFlag(CDKConstants.ISAROMATIC)) {
                  aromaticBondsCount += 1;
              }
          }
          return new DescriptorValue(getSpecification(), getParameterNames(), getParameters(), new IntegerResult(
                  aromaticBondsCount), getDescriptorNames());
      }
focal_method.class_method_signature: AromaticBondsCountDescriptor.calculate(IAtomContainer atomContainer)
focal_method.full_signature: @Override public DescriptorValue calculate(IAtomContainer atomContainer)
focal_method.identifier: calculate
focal_method.invocations: clone getSpecification getParameterNames getParameters getDescriptorNames percieveAtomTypesAndConfigureAtoms getSpecification getParameterNames getParameters getDescriptorNames apply cdkLegacy getSpecification getParameterNames getParameters getDescriptorNames getMessage iterator bonds hasNext next getFlag getSpecification getParameterNames getParameters getDescriptorNames
focal_method.modifiers: @Override public
focal_method.parameters: (IAtomContainer atomContainer)
focal_method.return: DescriptorValue
focal_method.signature: DescriptorValue calculate(IAtomContainer atomContainer)