Class Measure

java.lang.Object
overit.geocall.util.measure.Measure
All Implemented Interfaces:
Serializable
Direct Known Subclasses:
Distances, Temperatures, Weights

public abstract class Measure extends Object implements Serializable
Abstract class that defines an unit of measurement and its information.
A unit of measurement is characterized by an abbreviation symbol and by the class in which its conversion functions, from/to other units of measurement, are implemented.
See Also:
  • Constructor Details

    • Measure

      public Measure()
  • Method Details

    • register

      protected final void register()
    • get

      public static Measure get(String s)
      Gets the Measure object associated with the unit's symbol string passed as parameter.
      For example, for the "km" symbol it will be retieve the Distances.KILOMETERS object.
      Parameters:
      s - The string symbol of an unit of measurement
      Returns:
      The Measure object associated with the drive symbol string passed as a parameter if it exists, null otherwise.
    • getSymbol

      public abstract String getSymbol()
      Gets the symbol associated to the unit measurement.
      For example, kilometers have the "km" symbol, miles have the "mi" symbol and so on.
      Returns:
      The symbol associated to the unit measurement.
    • getConverterClass

      public abstract BaseConverter getConverterClass()
      Gets the class in which the conversion functions, from/to other units of measurement, are implemented.
      Returns:
      The class in which the conversion functions, from/to other units of measurement, are implemented.
    • getAlias

      public abstract String getAlias()
      Gets the alias name of the unit of measurement
      Returns:
      The alias name of the unit of measurement