Klasse ElementTable

java.lang.Object
java.util.AbstractMap<K,V>
java.util.EnumMap<Element,Integer>
org.lifstools.jgoslin.domain.ElementTable
Alle implementierten Schnittstellen:
Serializable, Cloneable, Map<Element,Integer>

public final class ElementTable extends EnumMap<Element,Integer>
Accounting table for chemical element frequency. This is used to calculate sum formulas and total masses for a given chemical element distribution, e.g. in a lipid.
Autor:
Dominik Kopczynski, Nils Hoffmann
Siehe auch:
  • Konstruktordetails

    • ElementTable

      public ElementTable()
      Create a new element table.
  • Methodendetails

    • of

      public static ElementTable of(Map.Entry<Element,Integer>... entries)
      Create a new element table from the provided entries.
      Parameter:
      entries - the entries
      Gibt zurück:
      a new element table.
    • add

      public void add(ElementTable elements)
      Add all elements and counts to those in this element table.
      Parameter:
      elements - the table to add to this one.
    • add

      public void add(ElementTable elements, int multiplier)
      Add all alements and counts to those in this element table, but use the count argument to multiply count values in the provided table.
      Parameter:
      elements -
      multiplier -
    • copy

      public ElementTable copy()
      Copy all entries in this element table. The copy will be completely independent of this instance.
      Gibt zurück:
      a copy of this element table.
    • getSumFormula

      public String getSumFormula()
      Returns the sum formula for all elements in this table.
      Gibt zurück:
      the sum formula. Returns an empty string if the table is empty.
    • getMass

      public Double getMass(Element element)
      Returns the individual total mass for the provided element.
      Parameter:
      element - the element to calculate the total mass for.
      Gibt zurück:
      the total mass for the given element, or 0.
    • getMass

      public Double getMass()
      Returns the total summed mass per number of elements.
      Gibt zurück:
      the total summed mass for this element table. Returns 0 if the table is empty.
    • getChargedMass

      public Double getChargedMass(int charge)
      Returns the total summed mass per number of elements, corrected for charge counts * electron rest mass.
      Parameter:
      charge - the charge of the molecule
      Gibt zurück:
      the total summed mass for this element table. Returns 0 if the table is empty.