Class TimeAmount


  • public class TimeAmount
    extends Object
    Class for the definition of time quantitys, both positive and negative. For example:
    • 10second
    • -1year
    • +2quarter

    • Constructor Detail

      • TimeAmount

        public TimeAmount()
    • Method Detail

      • getQuantity

        public long getQuantity()
      • setQuantity

        public void setQuantity​(long quantity)
      • toMillis

        public long toMillis()
      • cloneInstance

        public TimeAmount cloneInstance()
      • adjustDate

        public void adjustDate​(Date d)
      • parse

        public static TimeAmount parse​(String timeAmount)
        Parses a time amount expression. For example: "10second", "-1year", ...
        Returns:
        A TimeAmount instance.
        Throws:
        IllegalArgumentException - If the expression is not valid