com.caucho.util
Interface TimeInterval

All Superinterfaces:
java.lang.Comparable<TimeInterval>, ComparableElement<TimeInterval>, java.util.Comparator<TimeInterval>, TimeIntervalEntry
All Known Implementing Classes:
TimeIntervalElement

public interface TimeInterval
extends ComparableElement<TimeInterval>, java.util.Comparator<TimeInterval>, TimeIntervalEntry

Defines a TimeInterval, the period of time something is current.


Nested Class Summary
static class TimeInterval.Comparison
          Defines the set of relationships between two time intervals.
 
Method Summary
 boolean current()
          Returns true if the interval is current.
 boolean current(long time)
          Returns true if the interval is current at the time specified.
 long duration()
          Returns the duration of the interval in milliseconds.
 long startTime()
          Returns the time that the interval starts in milliseconds.
 long stopTime()
          Returns the time that the interval ends in milliseconds.
 
Methods inherited from interface com.caucho.util.ComparableElement
compareTo, compareWith
 
Methods inherited from interface java.util.Comparator
compare, equals
 
Methods inherited from interface com.caucho.util.TimeIntervalEntry
getTimeInterval
 

Method Detail

startTime

long startTime()
Returns the time that the interval starts in milliseconds.


stopTime

long stopTime()
Returns the time that the interval ends in milliseconds.

Returns:

duration

long duration()
Returns the duration of the interval in milliseconds.

Note that an internval with a duration of 0 is valid, and can be used to represent a moment in time.


current

boolean current()
Returns true if the interval is current.


current

boolean current(long time)
Returns true if the interval is current at the time specified.