test_class.file: descriptor/qsarmolecular/src/test/java/org/openscience/cdk/qsar/descriptors/molecular/BasicGroupCountDescriptorTest.java
test_class.identifier: BasicGroupCountDescriptorTest
test_class.superclass: extends MolecularDescriptorTest
test_case.body: @Test
      public void test() throws Exception {
          IChemObjectBuilder builder = SilentChemObjectBuilder.getInstance();
          IAtomContainer mol = builder.newInstance(IAtomContainer.class);
          IAtom a1 = builder.newInstance(IAtom.class, "N");
          mol.addAtom(a1);
          IAtom a2 = builder.newInstance(IAtom.class, "N");
          mol.addAtom(a2);
          IAtom a3 = builder.newInstance(IAtom.class, "C");
          mol.addAtom(a3);
          IAtom a4 = builder.newInstance(IAtom.class, "C");
          mol.addAtom(a4);
          IAtom a5 = builder.newInstance(IAtom.class, "H");
          mol.addAtom(a5);
          IAtom a6 = builder.newInstance(IAtom.class, "H");
          mol.addAtom(a6);
          IAtom a7 = builder.newInstance(IAtom.class, "H");
          mol.addAtom(a7);
          IAtom a8 = builder.newInstance(IAtom.class, "H");
          mol.addAtom(a8);
          IBond b1 = builder.newInstance(IBond.class, a1, a3, IBond.Order.SINGLE);
          mol.addBond(b1);
          IBond b2 = builder.newInstance(IBond.class, a1, a4, IBond.Order.DOUBLE);
          mol.addBond(b2);
          IBond b3 = builder.newInstance(IBond.class, a2, a3, IBond.Order.DOUBLE);
          mol.addBond(b3);
          IBond b4 = builder.newInstance(IBond.class, a2, a8, IBond.Order.SINGLE);
          mol.addBond(b4);
          IBond b5 = builder.newInstance(IBond.class, a3, a5, IBond.Order.SINGLE);
          mol.addBond(b5);
          IBond b6 = builder.newInstance(IBond.class, a4, a6, IBond.Order.SINGLE);
          mol.addBond(b6);
          IBond b7 = builder.newInstance(IBond.class, a4, a7, IBond.Order.SINGLE);
          mol.addBond(b7);
  
          AtomContainerManipulator.percieveAtomTypesAndConfigureAtoms(mol);
          addImplicitHydrogens(mol);
  
          IntegerResult result = (IntegerResult) descriptor.calculate(mol).getValue();
          // two SMARTS matches
          Assert.assertEquals(2, result.intValue());
      }
test_case.class_method_signature: BasicGroupCountDescriptorTest.test()
test_case.full_signature: @Test public void test()
test_case.identifier: test
test_case.invocations: getInstance newInstance newInstance addAtom newInstance addAtom newInstance addAtom newInstance addAtom newInstance addAtom newInstance addAtom newInstance addAtom newInstance addAtom newInstance addBond newInstance addBond newInstance addBond newInstance addBond newInstance addBond newInstance addBond newInstance addBond percieveAtomTypesAndConfigureAtoms addImplicitHydrogens getValue calculate assertEquals intValue
test_case.modifiers: @Test public
test_case.parameters: ()
test_case.return: void
test_case.signature: void test()
focal_class.declarator: SMARTS_STRINGS = {"[$([NH2]-[CX4])]", "[$([NH](-[CX4])-[CX4])]",
              "[$(N(-[CX4])(-[CX4])-[CX4])]", "[$([*;+;!$(*~[*;-])])]", "[$(N=C-N)]", "[$(N-C=N)]"}
focal_class.modifier: private final static
focal_class.original_string: private final static String[] SMARTS_STRINGS = {"[$([NH2]-[CX4])]", "[$([NH](-[CX4])-[CX4])]",
              "[$(N(-[CX4])(-[CX4])-[CX4])]", "[$([*;+;!$(*~[*;-])])]", "[$(N=C-N)]", "[$(N-C=N)]"};
focal_class.type: String[]
focal_class.var_name: SMARTS_STRINGS
focal_class.declarator: NAMES          = {"nBase"}
focal_class.modifier: private final static
focal_class.original_string: private final static String[] NAMES          = {"nBase"};
focal_class.type: String[]
focal_class.var_name: NAMES
focal_class.declarator: tools            = new ArrayList<SmartsPattern>()
focal_class.modifier: private
focal_class.original_string: private List<SmartsPattern> tools            = new ArrayList<SmartsPattern>();
focal_class.type: List<SmartsPattern>
focal_class.var_name: tools
focal_class.file: descriptor/qsarmolecular/src/main/java/org/openscience/cdk/qsar/descriptors/molecular/BasicGroupCountDescriptor.java
focal_class.identifier: BasicGroupCountDescriptor
focal_class.interfaces: implements IMolecularDescriptor
focal_class.class_method_signature: BasicGroupCountDescriptor.BasicGroupCountDescriptor()
focal_class.full_signature: public  BasicGroupCountDescriptor()
focal_class.identifier: BasicGroupCountDescriptor
focal_class.modifiers: public
focal_class.parameters: ()
focal_class.signature:  BasicGroupCountDescriptor()
focal_class.class_method_signature: BasicGroupCountDescriptor.initialise(IChemObjectBuilder builder)
focal_class.full_signature: @Override public void initialise(IChemObjectBuilder builder)
focal_class.identifier: initialise
focal_class.modifiers: @Override public
focal_class.parameters: (IChemObjectBuilder builder)
focal_class.return: void
focal_class.signature: void initialise(IChemObjectBuilder builder)
focal_class.class_method_signature: BasicGroupCountDescriptor.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: BasicGroupCountDescriptor.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: BasicGroupCountDescriptor.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: BasicGroupCountDescriptor.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: BasicGroupCountDescriptor.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: BasicGroupCountDescriptor.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: BasicGroupCountDescriptor.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: BasicGroupCountDescriptor.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: BasicGroupCountDescriptor.getDummyDescriptorValue(Exception exception)
focal_class.full_signature: private DescriptorValue getDummyDescriptorValue(Exception exception)
focal_class.identifier: getDummyDescriptorValue
focal_class.modifiers: private
focal_class.parameters: (Exception exception)
focal_class.return: DescriptorValue
focal_class.signature: DescriptorValue getDummyDescriptorValue(Exception exception)
focal_class.superclass: extends AbstractMolecularDescriptor
focal_method.body: @Override
      public DescriptorValue calculate(IAtomContainer atomContainer) {
  
          if (tools.isEmpty()) {
              throw new IllegalStateException("descriptor is not initalised, invoke 'initalise' first");
          }
  
          atomContainer = clone(atomContainer);
          for (IAtom atom : atomContainer.atoms()) {
              if (atom.getImplicitHydrogenCount() == null)
                  atom.setImplicitHydrogenCount(0);
          }
  
          int count = 0;
          for (SmartsPattern ptrn : tools) {
              count += ptrn.matchAll(atomContainer).count();
          }
          return new DescriptorValue(getSpecification(), getParameterNames(), getParameters(), new IntegerResult(
                  count), getDescriptorNames());
      }
focal_method.class_method_signature: BasicGroupCountDescriptor.calculate(IAtomContainer atomContainer)
focal_method.full_signature: @Override public DescriptorValue calculate(IAtomContainer atomContainer)
focal_method.identifier: calculate
focal_method.invocations: isEmpty clone atoms getImplicitHydrogenCount setImplicitHydrogenCount count matchAll 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)