public abstract class IsotopeFactory extends Object
Modifier and Type | Field and Description |
---|---|
protected Map<String,List<IIsotope>> |
isotopes |
protected static ILoggingTool |
logger |
protected Map<String,IIsotope> |
majorIsotopes |
Constructor and Description |
---|
IsotopeFactory() |
Modifier and Type | Method and Description |
---|---|
protected void |
add(IIsotope isotope)
Protected methods only to be used by classes extending this class to add
an IIsotope.
|
IAtom |
configure(IAtom atom)
Configures an atom.
|
IAtom |
configure(IAtom atom,
IIsotope isotope)
Configures an atom to have all the data of the
given isotope.
|
void |
configureAtoms(IAtomContainer container)
Configures atoms in an AtomContainer to
carry all the correct data according to their element type.
|
IElement |
getElement(int atomicNumber)
Returns an element according to a given atomic number.
|
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.
|
IIsotope |
getIsotope(String symbol,
double exactMass,
double tolerance)
Get an isotope based on the element symbol and exact mass.
|
IIsotope |
getIsotope(String symbol,
int massNumber)
Get isotope based on element symbol and mass number.
|
IIsotope[] |
getIsotopes()
Gets a array of all isotopes known to the IsotopeFactory.
|
IIsotope[] |
getIsotopes(double exactMass,
double difference)
Gets an array of all isotopes matching the searched exact mass within
a certain difference.
|
IIsotope[] |
getIsotopes(String symbol)
Gets an array of all isotopes known to the IsotopeFactory for the given
element symbol.
|
IIsotope |
getMajorIsotope(int atomicNumber)
Returns the most abundant (major) isotope with a given atomic number.
|
IIsotope |
getMajorIsotope(String symbol)
Returns the most abundant (major) isotope whose symbol equals element.
|
double |
getNaturalMass(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.
|
protected static ILoggingTool logger
@TestMethod(value="testGetSize") public int getSize()
protected void add(IIsotope isotope)
@TestMethod(value="testGetIsotopes_String") public IIsotope[] getIsotopes(String symbol)
symbol
- An element symbol to search for@TestMethod(value="testGetIsotopes") public IIsotope[] getIsotopes()
@TestMethod(value="testGetIsotopes_double_double") public IIsotope[] getIsotopes(double exactMass, double difference)
exactMass
- search massdifference
- mass the isotope is allowed to differ from the search mass@TestMethod(value="testGetIsotope") public IIsotope getIsotope(String symbol, int massNumber)
symbol
- the element symbolmassNumber
- the mass number@TestMethod(value="testGetIsotopeFromExactMass") public IIsotope getIsotope(String symbol, double exactMass, double tolerance)
symbol
- the element symbolexactMass
- the mass numbertolerance
- allowed difference from provided exact mass@TestMethod(value="testGetMajorIsotope_int") public IIsotope getMajorIsotope(int atomicNumber)
The isotope's abundance 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 abundance is defined as a percentage.
atomicNumber
- The atomicNumber for which an isotope is to be returnedgetMajorIsotope(String symbol)
@TestMethod(value="testIsElement_String") public boolean isElement(String elementName)
elementName
- The element name to test@TestMethod(value="testGetMajorIsotope_String") public IIsotope getMajorIsotope(String symbol)
symbol
- the symbol of the element in question@TestMethod(value="testGetElement_String") public IElement getElement(String symbol)
symbol
- The element symbol for the requested element@TestMethod(value="testGetElement_int") public IElement getElement(int atomicNumber)
atomicNumber
- The elements atomic number@TestMethod(value="testGetElementSymbol_int") public String getElementSymbol(int atomicNumber)
atomicNumber
- The elements atomic number@TestMethod(value="testConfigure_IAtom") public IAtom configure(IAtom atom)
IllegalArgumentException
.atom
- The atom to be configured@TestMethod(value="testConfigure_IAtom_IIsotope") public IAtom configure(IAtom atom, IIsotope isotope)
atom
- The atom to be configureisotope
- The isotope to read the data from@TestMethod(value="testConfigureAtoms_IAtomContainer") public void configureAtoms(IAtomContainer container)
container
- The AtomContainer to be configured@TestMethod(value="testGetNaturalMass_IElement") public double getNaturalMass(IElement element)
element
- the element in questionCopyright © 2014. All Rights Reserved.