Class Cost

All Implemented Interfaces:
Serializable, Comparable<PrmNumber>

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

    • ZERO_COST

      public static final Cost ZERO_COST
      Zero value
    • MAX_COST

      public static final Cost MAX_COST
      Maximum value
    • MIN_COST

      public static final Cost MIN_COST
      Minimum value
  • Constructor Details

    • Cost

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

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

    • compareTo

      public int compareTo(PrmNumber obj)
      Compares two Cost 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 Cost numerically equal to this Cost; a value less than 0 if the argument is a Cost numerically greater than this Cost, or if the argument is not a Cost; and a value greater than 0 if the argument is a Cost numerically less than this Cost.
    • getValue

      public double getValue()
      Gets the cost value represented by this object.
      Returns:
      a cost value