public class AtomChain extends ExperimentObject
NO_KEY
Constructor and Description |
---|
AtomChain()
Creates an empty atom chain.
|
Modifier and Type | Method and Description |
---|---|
void |
append(AtomImpl atom)
Appends an atom to the chain of atoms.
|
void |
append(AtomImpl atom,
int occurrence)
Appends an atom to the chain of atoms.
|
AtomChain |
clone() |
ArrayList<AtomImpl> |
getAtomChain()
Returns the atom chain as a list of AtomImpl.
|
static AtomChain |
getAtomChain(String atomChainAsString)
Returns an atom chain from the input as string.
|
double |
getMass()
Returns the mass of the atomic chain as sum of the individual atoms.
|
int |
getOccurrence(Atom atom,
Integer isotope)
Returns the occurrence of a given atom in the chain.
|
String |
getStringValue(boolean includeSpaces,
boolean includeBrackets,
boolean alwaysIncludeNumber,
boolean isotopeCurlyBrackets,
boolean negative,
boolean alwaysRecreate)
Sets the string value from the stringValue attribute, sets it from the
composition if not set.
|
boolean |
isSameCompositionAs(AtomChain anotherChain)
Indicates whether two atom chains are of the same composition by
comparing their string and type.
|
void |
remove(Atom atom,
Integer isotope)
Removes all the occurrences of the given atom.
|
void |
setOccurrence(Atom atom,
Integer isotope,
Integer occurrence)
Sets the occurrence of a given atom.
|
int |
size()
Returns the number of atoms in this atom chain.
|
String |
toString() |
addUrParam, asLong, clearParametersMap, getId, getUrParam, getUrParams, removeUrParam, setId, setUrParams
public static AtomChain getAtomChain(String atomChainAsString)
atomChainAsString
- the atomic chain as a stringpublic void append(AtomImpl atom)
atom
- a new atompublic void append(AtomImpl atom, int occurrence)
atom
- a new atomoccurrence
- the number of times this atom should be addedpublic ArrayList<AtomImpl> getAtomChain()
public double getMass()
public int size()
public String getStringValue(boolean includeSpaces, boolean includeBrackets, boolean alwaysIncludeNumber, boolean isotopeCurlyBrackets, boolean negative, boolean alwaysRecreate)
includeSpaces
- boolean indicating whether spaces should be included
between atomsincludeBrackets
- boolean indicating whether brackets are included
for the number of occurrences of each atomalwaysIncludeNumber
- boolean indicating whether the number is shown
even when there is only one occurrence of an atomisotopeCurlyBrackets
- if true, the isotopes are indicated as curly
brackets after the atom, e.g. carbon 13 is written as C{13}, if false,
the isotopes are indicated as a number before the atom, e.g. carbon 13 is
written as 13Cnegative
- if true, a minus sign is added in front of the occurrence
valuesalwaysRecreate
- if true, the string value will be recreated even if
it already exists (use in order to not overwrite the standard format)public int getOccurrence(Atom atom, Integer isotope)
atom
- the atom of interestisotope
- the isotope to look forpublic void remove(Atom atom, Integer isotope)
atom
- the atomisotope
- the isotopepublic void setOccurrence(Atom atom, Integer isotope, Integer occurrence)
atom
- the atomisotope
- the isotope numberoccurrence
- the occurrencepublic boolean isSameCompositionAs(AtomChain anotherChain)
anotherChain
- another atom chainCopyright © 2021. All rights reserved.