java.lang.Object
com.compomics.util.experiment.personalization.ExperimentObject
com.compomics.util.experiment.biology.atoms.AtomImpl
All Implemented Interfaces:
Serializable

public class AtomImpl
extends ExperimentObject
Class for a specific atom.
Author:
Marc Vaudel, Harald Barsnes
See Also:
Serialized Form
  • Constructor Details

    • AtomImpl

      public AtomImpl()
      Empty default constructor.
    • AtomImpl

      public AtomImpl​(String atomSymbol, Integer isotope)
      Constructor.
      Parameters:
      atomSymbol - the symbol of the atom
      isotope - the isotope, 0 for monoisotope
    • AtomImpl

      public AtomImpl​(Atom atom, Integer isotope)
      Constructor.
      Parameters:
      atom - the reference atom
      isotope - the isotope, 0 for monoisotope
  • Method Details

    • getMass

      public Double getMass()
      Returns the mass of the atom. Null if not implemented.
      Returns:
      the mass of the atom
    • getIsotopeNumber

      public Integer getIsotopeNumber​(Integer roundedMass)
      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

      public String toString()
      Overrides:
      toString in class Object
    • toString

      public String toString​(boolean isotopeCurlyBrackets)
      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

      public boolean isSameAs​(AtomImpl anotherAtom)
      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

      public String getAtomSymbol()
      Returns the atom symbol as specified in the Atom class.
      Returns:
      the atom symbol
    • setAtomSymbol

      public void setAtomSymbol​(String atomSymbol)
      Sets the atom symbol as specified in the Atom class.
      Parameters:
      atomSymbol - the atom symbol
    • getIsotope

      public Integer getIsotope()
      Returns the isotope, 0 for monoisotope.
      Returns:
      the isotope
    • setIsotope

      public void setIsotope​(Integer isotope)
      Sets the isotope, 0 for monoisotope.
      Parameters:
      isotope - the isotope