Class AtomImpl
java.lang.Object
com.compomics.util.experiment.personalization.ExperimentObject
com.compomics.util.experiment.biology.atoms.AtomImpl
- All Implemented Interfaces:
Serializable
Class for a specific atom.
- Author:
- Marc Vaudel, Harald Barsnes
- See Also:
-
Field Summary
Fields inherited from class com.compomics.util.experiment.personalization.ExperimentObject
NO_KEY -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionReturns the atom symbol as specified in the Atom class.Returns the isotope, 0 for monoisotope.getIsotopeNumber(Integer roundedMass) Returns the isotope number corresponding to the given rounded mass.getMass()Returns the mass of the atom.booleanIndicates whether another atom is the same as this one.voidsetAtomSymbol(String atomSymbol) Sets the atom symbol as specified in the Atom class.voidsetIsotope(Integer isotope) Sets the isotope, 0 for monoisotope.toString()toString(boolean isotopeCurlyBrackets) Returns the atom as a string.Methods inherited from class com.compomics.util.experiment.personalization.ExperimentObject
addUrParam, asLong, clearParametersMap, getId, getUrParam, getUrParams, removeUrParam, setId, setUrParams
-
Constructor Details
-
AtomImpl
public AtomImpl()Empty default constructor. -
AtomImpl
Constructor.- Parameters:
atomSymbol- the symbol of the atomisotope- the isotope, 0 for monoisotope
-
AtomImpl
Constructor.- Parameters:
atom- the reference atomisotope- the isotope, 0 for monoisotope
-
-
Method Details
-
getMass
Returns the mass of the atom. Null if not implemented.- Returns:
- the mass of the atom
-
getIsotopeNumber
Returns the isotope number corresponding to the given rounded mass. e.g. returns +1 for 13 if the atom is C. Null if no isotope was found.- Parameters:
roundedMass- the rounded mass as integer- Returns:
- the isotope number
-
toString
-
toString
Returns the atom as a string.- Parameters:
isotopeCurlyBrackets- 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 13C- Returns:
- the atom as a string
-
isSameAs
Indicates whether another atom is the same as this one.- Parameters:
anotherAtom- another atom of interest- Returns:
- a boolean indicating whether another atom is the same as this one
-
getAtomSymbol
Returns the atom symbol as specified in the Atom class.- Returns:
- the atom symbol
-
setAtomSymbol
Sets the atom symbol as specified in the Atom class.- Parameters:
atomSymbol- the atom symbol
-
getIsotope
Returns the isotope, 0 for monoisotope.- Returns:
- the isotope
-
setIsotope
Sets the isotope, 0 for monoisotope.- Parameters:
isotope- the isotope
-