CovalentRadiusDescriptor extends AbstractAtomicDescriptor implements IAtomicDescriptor { @Override public DescriptorValue calculate(IAtom atom, IAtomContainer container) { if (factory == null) try { factory = AtomTypeFactory.getInstance("org/openscience/cdk/config/data/jmol_atomtypes.txt", container.getBuilder()); } catch (Exception exception) { return new DescriptorValue(getSpecification(), getParameterNames(), getParameters(), new DoubleResult( Double.NaN), getDescriptorNames(), exception); } double covalentradius; try { String symbol = atom.getSymbol(); IAtomType type = factory.getAtomType(symbol); covalentradius = type.getCovalentRadius(); return new DescriptorValue(getSpecification(), getParameterNames(), getParameters(), new DoubleResult( covalentradius), getDescriptorNames()); } catch (Exception exception) { logger.debug(exception); return new DescriptorValue(getSpecification(), getParameterNames(), getParameters(), new DoubleResult( Double.NaN), getDescriptorNames(), exception); } } CovalentRadiusDescriptor(); @Override DescriptorSpecification getSpecification(); @Override void setParameters(Object[] params); @Override Object[] getParameters(); @Override String[] getDescriptorNames(); @Override DescriptorValue calculate(IAtom atom, IAtomContainer container); @Override String[] getParameterNames(); @Override Object getParameterType(String name);  }
@Test public void testVdWRadiusDescriptor() throws ClassNotFoundException, CDKException, java.lang.Exception { double[] testResult = {0.77}; IAtomicDescriptor descriptor = new CovalentRadiusDescriptor(); SmilesParser sp = new SmilesParser(DefaultChemObjectBuilder.getInstance()); IAtomContainer mol = sp.parseSmiles("NCCN(C)(C)"); double retval = ((DoubleResult) descriptor.calculate(mol.getAtom(1), mol).getValue()).doubleValue(); Assert.assertEquals(testResult[0], retval, 0.01); }