Package jhd.Formulas
Class FormulaList
java.lang.Object
gray.AtomData.AtomData
nist.MuMassData.LookupNIST
jhd.Formulas.FormulaList
- 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 Summary
Constructors Constructor Description FormulaList()
-
Method Summary
Modifier and Type Method Description java.util.ArrayList<AtomData>
createFormulaList(java.lang.String theFormula)
Returns an ArrayList of AtomData Objects.double
getAtomCount(java.util.ArrayList<AtomData> formulaList, int index)
double
getAtomDensity(java.util.ArrayList<AtomData> formulaList, int index)
java.lang.String
getAtomName(java.util.ArrayList<AtomData> formulaList, int index)
int
getAtomNumber(java.util.ArrayList<AtomData> formulaList, int index)
java.lang.String
getAtomSymbol(java.util.ArrayList<AtomData> formulaList, int index)
double
getAtomWeight(java.util.ArrayList<AtomData> formulaList, int index)
Methods inherited from class nist.MuMassData.LookupNIST
getabsEdgeNames, getAtomAbsEdge, getAtomMevArray, getAtomMuMass
Methods inherited from class gray.AtomData.AtomData
getAtomCount, getAtomDensity, getAtomGmPerCC, getAtomName, getAtomNames, getAtomNum, getAtomNumber, getAtomsGmPerCC, getAtomsGmPerMol, getAtomSymbol, getAtomSymbols, getAtomWeight, getAtomWeight, setAtomCount, setAtomSymbol
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Constructor Details
-
FormulaList
public FormulaList()
-
-
Method Details
-
getAtomName
- Parameters:
formulaList
- A list containing atom data. See createFormulaListindex
- the position in the formulalist- Returns:
- The atom name e.g. "chromium"
-
getAtomSymbol
- Parameters:
formulaList
- A list containing atom data. See createFormulaListindex
- the position in the formulalist- Returns:
- The atom name e.g. "CR" for chromium
-
getAtomCount
- Parameters:
formulaList
- A list containing atom data. See createFormulaListindex
- the position in the formulalist- Returns:
- The count for the atom at the formula list index
-
getAtomWeight
- Parameters:
formulaList
- A list containing atom data. See createFormulaListindex
- the position in the formulalist- Returns:
- The atomic weight in gm/mol for the atom at the formula list index
-
getAtomNumber
- Parameters:
formulaList
- A list containing atom data. See createFormulaListindex
- the position in the formulalist- Returns:
- Z, the atomic number for the atom at the formula list index
-
getAtomDensity
- Parameters:
formulaList
- A list containing atom data. See createFormulaListindex
- the position in the formulalist- Returns:
- the density in gm/cc for the atom at the formula list index
-
createFormulaList
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
-