Package org.openscience.cdk.interfaces
Interface IChemObjectBuilder
-
- All Known Implementing Classes:
DebugChemObjectBuilder
,DefaultChemObjectBuilder
,SilentChemObjectBuilder
public interface IChemObjectBuilder
A helper class to instantiate aICDKObject
instance for a specific implementation.- Author:
- egonw
- Source code:
- main
- Belongs to CDK module:
- interfaces
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description IAtom
newAtom()
Create a new atom using the default constructor.IAtomContainer
newAtomContainer()
Create a new atom container using the default constructor.IBond
newBond()
Create a new bond using the default constructor.<T extends ICDKObject>
TnewInstance(Class<T> clazz, Object... params)
Creates a new instance of anICDKObject
, using the constructor defined by the given parameters.IReaction
newReaction()
Create a new reaction using the default constructor.
-
-
-
Method Detail
-
newInstance
<T extends ICDKObject> T newInstance(Class<T> clazz, Object... params) throws IllegalArgumentException
Creates a new instance of anICDKObject
, using the constructor defined by the given parameters.- Type Parameters:
T
- Class of an interface extendingICDKObject
orICDKObject
itself.- Parameters:
clazz
- Interface class to instantiate an instance for.params
- Parameters passed to the constructor of the created instance.- Returns:
- Instance created.
- Throws:
IllegalArgumentException
- Exception thrown when theIChemObjectBuilder
builder cannot instantiate theclazz
with the given parameters.
-
newAtom
IAtom newAtom()
Create a new atom using the default constructor. This method is considerably faster than the dynamic dispatch ofnewInstance(IAtom.class)
and should be used for high throughput applications (e.g. IO).- Returns:
- new atom
-
newBond
IBond newBond()
Create a new bond using the default constructor. This method is considerably faster than the dynamic dispatch ofnewInstance(IBond.class)
and should be used for high throughput applications (e.g. IO).- Returns:
- new bond
-
newAtomContainer
IAtomContainer newAtomContainer()
Create a new atom container using the default constructor. This method is considerably faster than the dynamic dispatch ofnewInstance(IAtomContainer.class)
and should be used for high throughput applications (e.g. IO).- Returns:
- the new atom container
-
newReaction
IReaction newReaction()
Create a new reaction using the default constructor. This method is considerably faster than the dynamic dispatch ofnewInstance(IReaction.class)
and should be used for high throughput applications (e.g. IO).- Returns:
- the new reaction
-
-