public class Molecule extends Object implements Matter, HfgXMLSerializable, Cloneable, Comparable
Modifier and Type | Field and Description |
---|---|
static Molecule |
H2O |
protected boolean |
mLocked |
protected String |
mName |
static Molecule |
NaCl |
static Molecule |
NH3 |
Constructor and Description |
---|
Molecule() |
Molecule(Map<Element,Float> inElementalComposition) |
Molecule(Matter inInitialValue) |
Molecule(String inName) |
Molecule(String inName,
Map<Element,Float> inElementalComposition) |
Molecule(XMLNode inXML) |
Modifier and Type | Method and Description |
---|---|
Molecule |
add(Matter inValue) |
Molecule |
add(Matter inValue,
int inCount) |
Molecule |
addAtom(Atom inAtom) |
Molecule |
addAtoms(Element inElement,
float inNum) |
Molecule |
addAtoms(Element inElement,
int inNum) |
Molecule |
addAtoms(List<Atom> inAtoms) |
Molecule |
addElementalComposition(ElementalComposition inElementalComposition,
int inNum) |
Molecule |
addElementalComposition(Map<Element,Float> inMap) |
Molecule |
addElementalComposition(Map<Element,Float> inMap,
int inNum) |
Molecule |
addKa(IonizableGroup inValue) |
Molecule |
addKa(IonizableGroup inValue,
int inCount) |
protected void |
calculateMassFromElementalComposition() |
void |
clearAttributes() |
void |
clearCalculatedProperties() |
void |
clearElementalComposition() |
Molecule |
clone()
Returns an unlocked copy of the Molecule.
|
int |
compareTo(Object inObj) |
boolean |
equals(Object inObj) |
protected static String |
formatMassString(double inValue) |
List<Atom> |
getAtoms() |
Object |
getAttribute(String inName) |
Collection<String> |
getAttributeNames() |
Double |
getAverageMass() |
String |
getChemicalFormula()
Returns a chemical formula String like 'C5H11NO'.
|
String |
getChemicalFormulaWithSubscripts()
Returns a chemical formula String like 'Câ‚…Hâ‚â‚NO'.
|
Map<Element,Float> |
getElementalComposition()
Returns the elemental composition as an unmodifiable Map.
|
List<IonizableGroup> |
getKas()
Returns a List of IonizableGroup objects.
|
Atom |
getLastAtom() |
Double |
getMonoisotopicMass() |
Double |
getOrganicAverageMass() |
Double |
getPhysicalProperty(PhysicalProperty inProperty) |
boolean |
hasAttribute(String inName) |
boolean |
hasAttributes() |
int |
hashCode() |
boolean |
isLocked() |
Molecule |
lock() |
protected boolean |
massesAreUserSet() |
String |
name() |
Molecule |
remove(Matter inValue) |
Molecule |
remove(Matter inValue,
int inCount) |
Object |
removeAttribute(String inName) |
void |
setAttribute(String inName,
Object inValue) |
Molecule |
setAverageMass(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.
|
Molecule |
setChemicalFormula(String inValue) |
void |
setElementalComposition(Map<Element,Float> inMap) |
Molecule |
setMonoisotopicMass(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.
|
Molecule |
setName(String inValue) |
Molecule |
setOrganicAverageMass(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.
|
Molecule |
setPhysicalProperty(PhysicalProperty inProperty,
Double inValue) |
String |
toString() |
XMLNode |
toXMLNode() |
protected boolean mLocked
public Molecule()
public int compareTo(Object inObj)
compareTo
in interface Comparable
public boolean isLocked()
public void setElementalComposition(Map<Element,Float> inMap)
public void clearElementalComposition()
public Molecule addElementalComposition(Map<Element,Float> inMap)
public Molecule addElementalComposition(Map<Element,Float> inMap, int inNum)
public Molecule addElementalComposition(ElementalComposition inElementalComposition, int inNum)
public Atom getLastAtom()
public Molecule setMonoisotopicMass(Double inValue)
inValue
- the mass to use as the monoisotopic mass for this objectpublic Double getMonoisotopicMass()
getMonoisotopicMass
in interface Matter
public Molecule setAverageMass(Double inValue)
inValue
- the mass to use as the average mass for this objectpublic Double getAverageMass()
getAverageMass
in interface Matter
public Molecule setOrganicAverageMass(Double inValue)
inValue
- the mass to use as the organic average mass for this objectpublic Double getOrganicAverageMass()
getOrganicAverageMass
in interface Matter
public Map<Element,Float> getElementalComposition()
getElementalComposition
in interface Matter
public Molecule setChemicalFormula(String inValue)
public String getChemicalFormula()
getChemicalFormula
in interface Matter
public String getChemicalFormulaWithSubscripts()
public void clearCalculatedProperties()
public Molecule addKa(IonizableGroup inValue)
public Molecule addKa(IonizableGroup inValue, int inCount)
public List<IonizableGroup> getKas()
public Double getPhysicalProperty(PhysicalProperty inProperty)
public Molecule setPhysicalProperty(PhysicalProperty inProperty, Double inValue)
public void setAttribute(String inName, Object inValue)
public boolean hasAttributes()
public boolean hasAttribute(String inName)
public Object getAttribute(String inName)
public Collection<String> getAttributeNames()
public void clearAttributes()
public Object removeAttribute(String inName)
public XMLNode toXMLNode()
toXMLNode
in interface HfgXMLSerializable
protected void calculateMassFromElementalComposition()
protected boolean massesAreUserSet()
protected static String formatMassString(double inValue)