Class Unit

All Implemented Interfaces:
Serializable, Comparable<PrmNumber>

public class Unit extends PrmNumber
This value type is used to define a unit.
See Also:
  • Field Details

    • MIN_UNIT

      public static final Unit MIN_UNIT
      Minimum value
    • ZERO_UNIT

      public static final Unit ZERO_UNIT
      Zero value
    • MAX_UNIT

      public static final Unit MAX_UNIT
      Maximum value
  • Constructor Details

    • Unit

      public Unit(double d)
      Constructs a Unit object with a given unit value in double format.
      Parameters:
      d - the unit value
    • Unit

      public Unit(Number n)
      Constructs a Unit object with a given unit value in Number format.
      Parameters:
      n - the unit value
  • Method Details

    • compareTo

      public int compareTo(PrmNumber obj)
      Compares two Unit objects.
      Specified by:
      compareTo in interface Comparable<PrmNumber>
      Overrides:
      compareTo in class PrmNumber
      Parameters:
      obj - the Object to be compared.
      Returns:
      the value 0 if the argument is a Unit numerically equal to this Unit; a value less than 0 if the argument is a Unit numerically greater than this Unit, or if the argument is not a Unit; and a value greater than 0 if the argument is a Unit numerically less than this Unit.