public class MatterImpl extends java.lang.Object implements Matter, java.lang.Cloneable, java.lang.Comparable<MatterImpl>
Constructor and Description |
---|
MatterImpl() |
MatterImpl(java.util.Map<Element,java.lang.Float> inMap) |
MatterImpl(Matter inInitialValue) |
Modifier and Type | Method and Description |
---|---|
MatterImpl |
add(Matter inValue) |
MatterImpl |
add(Matter inValue,
int inCount) |
MatterImpl |
addAtoms(Element inElement,
float inNum) |
MatterImpl |
addAtoms(Element inElement,
int inNum) |
MatterImpl |
addElementalComposition(java.util.Map<Element,java.lang.Float> inMap) |
MatterImpl |
addElementalComposition(java.util.Map<Element,java.lang.Float> inMap,
int inNum) |
protected void |
calculateMassFromElementalComposition() |
void |
clearCalculatedProperties() |
void |
clearElementalComposition() |
MatterImpl |
clone() |
int |
compareTo(MatterImpl inObj) |
boolean |
equals(java.lang.Object inObj) |
static Matter |
fromChemicalFormula(java.lang.String inChemicalFormula) |
java.lang.Double |
getAverageMass() |
java.lang.String |
getChemicalFormula()
Returns a chemical formula String like 'C5H11NO'.
|
java.lang.String |
getChemicalFormulaWithSubscripts()
Returns a chemical formula String like 'C₅H₁₁NO'.
|
java.util.Map<Element,java.lang.Float> |
getElementalComposition()
Returns the elemental composition as an unmodifiable Map.
|
java.lang.Double |
getMonoisotopicMass() |
int |
hashCode() |
protected boolean |
massesAreUserSet() |
MatterImpl |
remove(Matter inValue) |
MatterImpl |
remove(Matter inValue,
int inCount) |
MatterImpl |
setAverageMass(java.lang.Double inValue)
If the elemental composition is known, use setElementalComposition() and
the masses will be derived automatically; this method is for use in those
(hopefully) rare times when the mass is known but not the elemental composition.
|
void |
setElementalComposition(java.util.Map<Element,java.lang.Float> inMap) |
MatterImpl |
setMonoisotopicMass(java.lang.Double inValue)
If the elemental composition is known, use setElementalComposition() and
the masses will be derived automatically; this method is for use in those
(hopefully) rare times when the mass is known but not the elemental composition.
|
public MatterImpl()
public MatterImpl(java.util.Map<Element,java.lang.Float> inMap)
public MatterImpl(Matter inInitialValue)
public static Matter fromChemicalFormula(java.lang.String inChemicalFormula)
public int hashCode()
hashCode
in class java.lang.Object
public boolean equals(java.lang.Object inObj)
equals
in class java.lang.Object
public int compareTo(MatterImpl inObj)
compareTo
in interface java.lang.Comparable<MatterImpl>
public void setElementalComposition(java.util.Map<Element,java.lang.Float> inMap)
public void clearElementalComposition()
public MatterImpl addElementalComposition(java.util.Map<Element,java.lang.Float> inMap)
public MatterImpl addElementalComposition(java.util.Map<Element,java.lang.Float> inMap, int inNum)
public MatterImpl add(Matter inValue)
public MatterImpl add(Matter inValue, int inCount)
public MatterImpl remove(Matter inValue)
public MatterImpl remove(Matter inValue, int inCount)
public MatterImpl addAtoms(Element inElement, int inNum)
public MatterImpl addAtoms(Element inElement, float inNum)
public MatterImpl setMonoisotopicMass(java.lang.Double inValue)
inValue
- the mass to use as the monoisotopic mass for this objectpublic MatterImpl setAverageMass(java.lang.Double inValue)
inValue
- the mass to use as the average mass for this objectpublic java.lang.Double getMonoisotopicMass()
getMonoisotopicMass
in interface Matter
public java.lang.Double getAverageMass()
getAverageMass
in interface Matter
public java.util.Map<Element,java.lang.Float> getElementalComposition()
getElementalComposition
in interface Matter
public java.lang.String getChemicalFormula()
public java.lang.String getChemicalFormulaWithSubscripts()
public MatterImpl clone()
clone
in class java.lang.Object
public void clearCalculatedProperties()
protected void calculateMassFromElementalComposition()
protected boolean massesAreUserSet()
jataylor@hairyfatguy.com