public class DefaultChemObjectBuilder extends Object implements IChemObjectBuilder
ICDKObjects.
IChemObjectBuilder builder = DefaultChemObjectBuilder.getInstance();
IAtom a = builder.newInstance(IAtom.class);
IAtom c12 = builder.newInstance(IAtom.class, "C");
IAtom c13 = builder.newInstance(IAtom.class,
builder.newInstance(IIsotope.class,
"C", 13));
| Modifier and Type | Method and Description |
|---|---|
static IChemObjectBuilder |
getInstance()
Access the singleton instance of this DefaultChemObjectBuilder.
|
IAtom |
newAtom() |
IAtomContainer |
newAtomContainer() |
IBond |
newBond() |
<T extends ICDKObject> |
newInstance(Class<T> clazz,
Object... params) |
public static IChemObjectBuilder getInstance()
// get the builder instance
IChemObjectBuilder builder = DefaultChemObjectBuilder.getInstance();
// using the builder...
// create an IAtom using the default constructor
IAtom atom = builder.newInstance(IAtom.class);
// create a carbon atom
IAtom c1 = builder.newInstance(IAtom.class, "C");
public <T extends ICDKObject> T newInstance(Class<T> clazz, Object... params)
newInstance in interface IChemObjectBuilderpublic IAtom newAtom()
newAtom in interface IChemObjectBuilderpublic IBond newBond()
newBond in interface IChemObjectBuilderpublic IAtomContainer newAtomContainer()
newAtomContainer in interface IChemObjectBuilderCopyright © 2017. All rights reserved.