Class UnitOfMeasurement

java.lang.Object
com.compomics.util.experiment.personalization.ExperimentObject
com.compomics.util.experiment.units.UnitOfMeasurement
All Implemented Interfaces:
Serializable

public class UnitOfMeasurement
extends ExperimentObject
The unit to use for a measure.
Author:
Marc Vaudel
See Also:
Serialized Form
  • Constructor Details

    • UnitOfMeasurement

      public UnitOfMeasurement()
      Empty default constructor
    • UnitOfMeasurement

      public UnitOfMeasurement​(String fullName, String abbreviation, MetricsPrefix metricsPrefix)
      Constructor.
      Parameters:
      fullName - the full name of the unit
      abbreviation - the abbreviated name of the unit
      metricsPrefix - the metrics prefix
    • UnitOfMeasurement

      public UnitOfMeasurement​(StandardUnit standardUnit, MetricsPrefix metricsPrefix)
      Constructor.
      Parameters:
      standardUnit - a standard unit
      metricsPrefix - the metrics prefix
    • UnitOfMeasurement

      public UnitOfMeasurement​(StandardUnit standardUnit)
      Constructor.
      Parameters:
      standardUnit - a standard unit
  • Method Details

    • getFullName

      public String getFullName()
      Returns the full name of the unit.
      Returns:
      the full name of the unit
    • getAbbreviation

      public String getAbbreviation()
      Returns the abbreviated name of the unit.
      Returns:
      the abbreviated name of the unit
    • getMetricsPrefix

      public MetricsPrefix getMetricsPrefix()
      Returns the metrics prefix.
      Returns:
      the metrics prefix
    • getDisplayName

      public String getDisplayName()
      Returns the name to display, e.g. fmol.
      Returns:
      the name to display
    • toString

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

      public boolean isSameAs​(UnitOfMeasurement unitOfMeasurement)
      Indicates whether the given unit of measurement is the same as another.
      Parameters:
      unitOfMeasurement - an other unit of measurement
      Returns:
      a boolean indicating whether the given unit of measurement is the same as another