Class TimeValue

  • All Implemented Interfaces:

    public class TimeValue
    extends java.lang.Object
    implements java.lang.Comparable<TimeValue>
    • Field Detail


        public static final long NSEC_PER_MSEC
        How many nano-seconds in one milli-second
      • MINUS_ONE

        public static final TimeValue MINUS_ONE
      • MAX_VALUE

        public static final TimeValue MAX_VALUE
    • Constructor Detail

      • TimeValue

        public TimeValue​(long millis)
      • TimeValue

        public TimeValue​(long duration,
                         java.util.concurrent.TimeUnit timeUnit)
    • Method Detail

      • timeValueNanos

        public static TimeValue timeValueNanos​(long nanos)
      • timeValueMillis

        public static TimeValue timeValueMillis​(long millis)
      • timeValueSeconds

        public static TimeValue timeValueSeconds​(long seconds)
      • timeValueMinutes

        public static TimeValue timeValueMinutes​(long minutes)
      • timeValueHours

        public static TimeValue timeValueHours​(long hours)
      • duration

        public long duration()
        the number of timeUnit() units this value contains
      • timeUnit

        public java.util.concurrent.TimeUnit timeUnit()
        the unit used for the this time value, see duration()
      • nanos

        public long nanos()
      • getNanos

        public long getNanos()
      • micros

        public long micros()
      • getMicros

        public long getMicros()
      • millis

        public long millis()
      • getMillis

        public long getMillis()
      • seconds

        public long seconds()
      • getSeconds

        public long getSeconds()
      • minutes

        public long minutes()
      • getMinutes

        public long getMinutes()
      • hours

        public long hours()
      • getHours

        public long getHours()
      • days

        public long days()
      • getDays

        public long getDays()
      • microsFrac

        public double microsFrac()
      • getMicrosFrac

        public double getMicrosFrac()
      • millisFrac

        public double millisFrac()
      • getMillisFrac

        public double getMillisFrac()
      • secondsFrac

        public double secondsFrac()
      • getSecondsFrac

        public double getSecondsFrac()
      • minutesFrac

        public double minutesFrac()
      • getMinutesFrac

        public double getMinutesFrac()
      • hoursFrac

        public double hoursFrac()
      • getHoursFrac

        public double getHoursFrac()
      • daysFrac

        public double daysFrac()
      • getDaysFrac

        public double getDaysFrac()
      • toString

        public java.lang.String toString()
        Returns a String representation of the current TimeValue. Note that this method might produce fractional time values (ex 1.6m) which cannot be parsed by method like parse(String, String, String, String).
        toString in class java.lang.Object
      • getStringRep

        public java.lang.String getStringRep()
      • parseTimeValue

        public static TimeValue parseTimeValue​(java.lang.String sValue,
                                               java.lang.String settingName)
      • parseTimeValue

        public static TimeValue parseTimeValue​(java.lang.String sValue,
                                               TimeValue defaultValue,
                                               java.lang.String settingName)
      • equals

        public boolean equals​(java.lang.Object o)
        equals in class java.lang.Object
      • hashCode

        public int hashCode()
        hashCode in class java.lang.Object
      • nsecToMSec

        public static long nsecToMSec​(long ns)
      • compareTo

        public int compareTo​(TimeValue timeValue)
        Specified by:
        compareTo in interface java.lang.Comparable<TimeValue>