Class XMLIsotopeFactory

java.lang.Object
org.openscience.cdk.config.IsotopeFactory
org.openscience.cdk.config.XMLIsotopeFactory

public class XMLIsotopeFactory extends IsotopeFactory
Used to store and return data of a particular isotope. As this class is a singleton class, one gets an instance with:
 IsotopeFactory ifac = IsotopFactory.getInstance(new IChemObject().getNewBuilder());
 

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 = XMLIsotopeFactory.getInstance(DefaultChemObjectBuilder.getInstance());
   Isotope major = factory.getMajorIsotope("H");
 
Author:
steinbeck
Source code:
main
Belongs to CDK module:
extra
Keywords:
isotope, element
Created on:
2001-08-29
  • Method Details

    • getInstance

      public static XMLIsotopeFactory getInstance(IChemObjectBuilder builder) throws IOException
      Returns an IsotopeFactory instance.
      Parameters:
      builder - ChemObjectBuilder used to construct the Isotope's
      Returns:
      The instance value
      Throws:
      IOException - if isotopic data files could not be read.