peakml.chemistry
Class PeriodicTable.Element

java.lang.Object
  extended by peakml.chemistry.PeriodicTable.Element
Enclosing class:
PeriodicTable

public static class PeriodicTable.Element
extends java.lang.Object

Central class describing all the properties of an element. Properties include the valency, molecular weight, etc. Apart from this also all the known isotopes are tracked here. http://physics.nist.gov/PhysRefData/Compositions/index.html


Field Summary
 int id
          The index of the isotope in the list of elements.
 java.lang.String identifier
          The short name for the element.
 PeriodicTable.Isotope[] isotopes
          The list of isotopes.
 double massvariance
          The mass variance of the element.
 double molecularweight
          The molecular weight of the element.
 java.lang.String name
          The full length name of the element.
 int valency
          The valency of the element.
 
Constructor Summary
PeriodicTable.Element(int id, java.lang.String name, java.lang.String identifier, double molecularweight, double massvariance, int valency, PeriodicTable.Isotope... isotopes)
          Constructs a new element with the given information.
 
Method Summary
 double getAbundance()
          Returns the abundance (in percentage) at which the most abundant isotope occurs naturally.
 double getAbundance(int k)
          Returns the natural abundance of the isotope at the given index.
 int getAtomicMass()
          Returns the atomic mass of the most abundant isotope.
 int getAtomicMass(int k)
          Returns the atomic mass of the given isotope.
 int getID()
          Returns the index of the element in the table PeriodicTable.elements.
 java.lang.String getIdentifier()
          Returns the id (e.g.
 PeriodicTable.Isotope getIsotope(int k)
          Returns the isotope instance at the given position (0 is the most abundant isotope).
 PeriodicTable.Isotope[] getIsotopes()
          Returns an array of all the isotopes for the element.
 double getMass(Mass masstype)
          Returns the mass of the element.
 double getMassVariance()
          Returns the mass variance for the element.
 double getMolecularWeight()
          Returns the molecular weight of the isotope (the mixture of all isotopes as they occur naturally).
 double getMonoIsotopicWeight()
          Returns the mono-isotopic weight of the most abundant isotope.
 double getMonoIsotopicWeight(int k)
          Returns the mono isotopic weight of the isotope at the given index.
 java.lang.String getName()
          Returns the full name of the element.
 int getNrIsotopes()
          Returns the number of isotopes for this element.
 int getValency()
          Returns the valency of the element.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

id

public final int id
The index of the isotope in the list of elements.


name

public final java.lang.String name
The full length name of the element.


identifier

public final java.lang.String identifier
The short name for the element.


molecularweight

public final double molecularweight
The molecular weight of the element.


massvariance

public final double massvariance
The mass variance of the element.


valency

public final int valency
The valency of the element.


isotopes

public final PeriodicTable.Isotope[] isotopes
The list of isotopes.

Constructor Detail

PeriodicTable.Element

public PeriodicTable.Element(int id,
                             java.lang.String name,
                             java.lang.String identifier,
                             double molecularweight,
                             double massvariance,
                             int valency,
                             PeriodicTable.Isotope... isotopes)
Constructs a new element with the given information.

Parameters:
id - The index of the isotope in the list of elements.
name - The full length name of the element.
identifier - The short name for the element.
molecularweight - The molecular weight of the element
massvariance - The mass variance of the element.
valency - The valency of the element.
isotopes - The list of isotopes.
Method Detail

getID

public int getID()
Returns the index of the element in the table PeriodicTable.elements.

Returns:
The index of the element.

getName

public java.lang.String getName()
Returns the full name of the element.

Returns:
The full name of the element.

getIdentifier

public java.lang.String getIdentifier()
Returns the id (e.g. carbon has C) of the element.

Returns:
The id of the element.

getMass

public double getMass(Mass masstype)
Returns the mass of the element. The given masstype indicates whether the returned mass should be molecular mass (the mixture of all isotopes as they occur naturally) or mono-isotopic (the mass of the most common isotope).

Parameters:
masstype - The type of mass to return.
Returns:
The mass of the element.

getMolecularWeight

public double getMolecularWeight()
Returns the molecular weight of the isotope (the mixture of all isotopes as they occur naturally).

Returns:
The molecular weight.

getMassVariance

public double getMassVariance()
Returns the mass variance for the element.

Returns:
The mass variance for the element.

getValency

public final int getValency()
Returns the valency of the element. The valency denotes the number of 'connections' an element has to other atoms in a molecule. For example the carbon can be connected to 4 other elements with single bonds (a double bond counts for two connections).

Returns:
The valency for the element.

getNrIsotopes

public int getNrIsotopes()
Returns the number of isotopes for this element.

Returns:
The number of isotopes for the element.

getIsotopes

public PeriodicTable.Isotope[] getIsotopes()
Returns an array of all the isotopes for the element.

Returns:
An array with the isotopes.

getAtomicMass

public int getAtomicMass()
Returns the atomic mass of the most abundant isotope.

Returns:
The atomic mass of the most abundant isotope.

getMonoIsotopicWeight

public double getMonoIsotopicWeight()
Returns the mono-isotopic weight of the most abundant isotope.

Returns:
The mono-isotopic weight of the most abundant isotope.

getAbundance

public double getAbundance()
Returns the abundance (in percentage) at which the most abundant isotope occurs naturally.

Returns:
The natural abundancy of the most abundant isotope.

getIsotope

public PeriodicTable.Isotope getIsotope(int k)
Returns the isotope instance at the given position (0 is the most abundant isotope).

Parameters:
k - The index of the isotope.
Returns:
The isotope at the given index.

getAtomicMass

public int getAtomicMass(int k)
Returns the atomic mass of the given isotope.

Parameters:
k - The index of the isotope.
Returns:
The atomic mass of the isotope.

getMonoIsotopicWeight

public double getMonoIsotopicWeight(int k)
Returns the mono isotopic weight of the isotope at the given index.

Parameters:
k - The index of the isotope.
Returns:
The mono isotopic weight of the isotope.

getAbundance

public double getAbundance(int k)
Returns the natural abundance of the isotope at the given index.

Parameters:
k - The index of the isotope.
Returns:
The natural abundance of the isotope.