public class IsotopeFactory extends Object
IsotopeFactory ifac = IsotopFactory.getInstance(new IChemObject().getBuilder());
Data about the isotopes are read from the file org.openscience.cdk.config.isotopes.xml in the cdk-standard module. Part of the data in this file was collected from the website webelements.org.
The use of this class is exemplified as follows. To get information about the major isotope of hydrogen, one can use this code:
IsotopeFactory factory = IsotopeFactory.getInstance(SilentChemObjectBuilder.getInstance()); Isotope major = factory.getMajorIsotope("H");
Modifier and Type | Method and Description |
---|---|
org.openscience.cdk.interfaces.IAtom |
configure(org.openscience.cdk.interfaces.IAtom atom)
Configures an atom.
|
org.openscience.cdk.interfaces.IAtom |
configure(org.openscience.cdk.interfaces.IAtom atom,
org.openscience.cdk.interfaces.IIsotope isotope)
Configures an atom to have all the data of the
given isotope.
|
void |
configureAtoms(org.openscience.cdk.interfaces.IAtomContainer container)
Configures atoms in an AtomContainer to
carry all the correct data according to their element type.
|
org.openscience.cdk.interfaces.IElement |
getElement(int atomicNumber)
Returns an element according to a given atomic number.
|
org.openscience.cdk.interfaces.IElement |
getElement(String symbol)
Returns an Element with a given element symbol.
|
String |
getElementSymbol(int atomicNumber)
Returns the symbol matching the element with the given atomic number.
|
static IsotopeFactory |
getInstance(org.openscience.cdk.interfaces.IChemObjectBuilder builder)
Returns an IsotopeFactory instance.
|
org.openscience.cdk.interfaces.IIsotope[] |
getIsotopes(String symbol)
Gets an array of all isotopes known to the IsotopeFactory for the given
element symbol.
|
org.openscience.cdk.interfaces.IIsotope |
getMajorIsotope(int atomicNumber)
Returns the most abundant (major) isotope with a given atomic number.
|
org.openscience.cdk.interfaces.IIsotope |
getMajorIsotope(String symbol)
Returns the most abundant (major) isotope whose symbol equals element.
|
double |
getNaturalMass(org.openscience.cdk.interfaces.IElement element)
Gets the natural mass of this element, defined as average of masses of isotopes,
weighted by abundance.
|
int |
getSize()
Returns the number of isotopes defined by this class.
|
boolean |
isElement(String elementName)
Checks whether the given element exists.
|
public static IsotopeFactory getInstance(org.openscience.cdk.interfaces.IChemObjectBuilder builder) throws IOException
builder
- ChemObjectBuilder used to construct the Isotope'sIOException
- Description of the Exceptionpublic int getSize()
public org.openscience.cdk.interfaces.IIsotope[] getIsotopes(String symbol)
symbol
- An element symbol to search forpublic org.openscience.cdk.interfaces.IIsotope getMajorIsotope(int atomicNumber)
The isotope's abundancy is for atoms with atomic number 60 and smaller defined as a number that is proportional to the 100 of the most abundant isotope. For atoms with higher atomic numbers, the abundancy is defined as a percentage.
atomicNumber
- The atomicNumber for which an isotope is to be returnedgetMajorIsotope(String symbol)
public boolean isElement(String elementName)
elementName
- The element name to testpublic org.openscience.cdk.interfaces.IIsotope getMajorIsotope(String symbol)
symbol
- Description of the Parameterpublic org.openscience.cdk.interfaces.IElement getElement(String symbol)
symbol
- The element symbol for the requested elementpublic org.openscience.cdk.interfaces.IElement getElement(int atomicNumber)
atomicNumber
- The elements atomic numberpublic String getElementSymbol(int atomicNumber)
atomicNumber
- The elements atomic numberpublic org.openscience.cdk.interfaces.IAtom configure(org.openscience.cdk.interfaces.IAtom atom)
atom
- The atom to be configuredpublic org.openscience.cdk.interfaces.IAtom configure(org.openscience.cdk.interfaces.IAtom atom, org.openscience.cdk.interfaces.IIsotope isotope)
atom
- The atom to be configureisotope
- The isotope to read the data frompublic void configureAtoms(org.openscience.cdk.interfaces.IAtomContainer container)
container
- The AtomContainer to be configuredpublic double getNaturalMass(org.openscience.cdk.interfaces.IElement element)
element
- Description of the ParameterCopyright © 2004–2020 Ideaconsult Ltd.. All rights reserved.