Class Duration

All Implemented Interfaces:
Serializable, Comparable<PrmNumber>

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

    • ZERO_DURATION

      public static final Duration ZERO_DURATION
      Zero duration value
    • ONE_DURATION

      public static final Duration ONE_DURATION
      One duration value
    • MAX_DURATION

      public static final Duration MAX_DURATION
      Maximum duration value
    • MINUTES_IN_HOUR

      public static final int MINUTES_IN_HOUR
      Number of minutes in an hour
      See Also:
  • Constructor Details

    • Duration

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

      public Duration(double d, boolean flag)
    • Duration

      public Duration(Number n, boolean flag)
      Constructs a Duration object with a given duration value in Number format.
      Parameters:
      n - the duration value
    • Duration

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

    • compareTo

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