public class AtomChain extends Object implements Serializable
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.
|
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() |
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 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 © 2018. All rights reserved.