Package jhd.Formulas

Class FormulaList

java.lang.Object
Direct Known Subclasses:
MuMassCalculator

public class FormulaList
extends LookupNIST
A class for converting a chemical formula into a data structure populated with relevant information for computing photon cross sections.
Author:
John H Dunsmuir
  • Constructor Details

    • FormulaList

      public FormulaList()
  • Method Details

    • getAtomName

      public java.lang.String getAtomName​(java.util.ArrayList<AtomData> formulaList, int index)
      Parameters:
      formulaList - A list containing atom data. See createFormulaList
      index - the position in the formulalist
      Returns:
      The atom name e.g. "chromium"
    • getAtomSymbol

      public java.lang.String getAtomSymbol​(java.util.ArrayList<AtomData> formulaList, int index)
      Parameters:
      formulaList - A list containing atom data. See createFormulaList
      index - the position in the formulalist
      Returns:
      The atom name e.g. "CR" for chromium
    • getAtomCount

      public double getAtomCount​(java.util.ArrayList<AtomData> formulaList, int index)
      Parameters:
      formulaList - A list containing atom data. See createFormulaList
      index - the position in the formulalist
      Returns:
      The count for the atom at the formula list index
    • getAtomWeight

      public double getAtomWeight​(java.util.ArrayList<AtomData> formulaList, int index)
      Parameters:
      formulaList - A list containing atom data. See createFormulaList
      index - the position in the formulalist
      Returns:
      The atomic weight in gm/mol for the atom at the formula list index
    • getAtomNumber

      public int getAtomNumber​(java.util.ArrayList<AtomData> formulaList, int index)
      Parameters:
      formulaList - A list containing atom data. See createFormulaList
      index - the position in the formulalist
      Returns:
      Z, the atomic number for the atom at the formula list index
    • getAtomDensity

      public double getAtomDensity​(java.util.ArrayList<AtomData> formulaList, int index)
      Parameters:
      formulaList - A list containing atom data. See createFormulaList
      index - the position in the formulalist
      Returns:
      the density in gm/cc for the atom at the formula list index
    • createFormulaList

      public java.util.ArrayList<AtomData> createFormulaList​(java.lang.String theFormula)
      Returns an ArrayList of AtomData Objects.
      Parameters:
      theFormula - A string representation of a chemical formula e.g. Ca:1:C:1:O:3 for CaCO3
      Returns:
      An ArrayList of AtomData Objects, null if incorrect formula