public class TimeIntervalElement extends java.lang.Object implements TimeInterval
TimeInterval
interface.TimeInterval.Comparison
Constructor and Description |
---|
TimeIntervalElement(long starts,
long stops) |
Modifier and Type | Method and Description |
---|---|
int |
compare(TimeInterval interval1,
TimeInterval interval2) |
int |
compareTo(TimeInterval interval)
The recommended implementation of this method is:
public int compareTo(E element)
{
return comparison(element).value();
}
|
TimeInterval.Comparison |
compareWith(TimeInterval other)
Returns a result that provides a
ComparableElement.Comparison of this element
with that of the element parameter. |
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.
|
boolean |
equals(java.lang.Object other) |
TimeInterval |
getTimeInterval()
Returns the current time interval.
|
int |
hashCode()
Returns the hashCode that was calculated when this immutable instance was
instantiated.
|
protected long |
intervalNow()
Provides the current time for use by the interval.
|
long |
startTime()
Returns the time that the interval starts in milliseconds.
|
long |
stopTime()
Returns the time that the interval ends in milliseconds.
|
java.lang.String |
toString() |
public final long startTime()
TimeInterval
startTime
in interface TimeInterval
public final long stopTime()
TimeInterval
stopTime
in interface TimeInterval
public final long duration()
TimeInterval
duration
in interface TimeInterval
public final boolean current()
TimeInterval
current
in interface TimeInterval
public final boolean current(long time)
TimeInterval
current
in interface TimeInterval
public final boolean equals(java.lang.Object other)
equals
in interface java.util.Comparator<TimeInterval>
equals
in class java.lang.Object
public final int hashCode()
hashCode
in class java.lang.Object
public final int compareTo(TimeInterval interval)
ComparableElement
public int compareTo(E element)
{
return comparison(element).value();
}
compareTo
in interface ComparableElement<TimeInterval>
compareTo
in interface java.lang.Comparable<TimeInterval>
public final int compare(TimeInterval interval1, TimeInterval interval2)
compare
in interface java.util.Comparator<TimeInterval>
public final TimeInterval.Comparison compareWith(TimeInterval other)
ComparableElement
ComparableElement.Comparison
of this element
with that of the element parameter.compareWith
in interface ComparableElement<TimeInterval>
other
- to be compared with.protected long intervalNow()
public TimeInterval getTimeInterval()
TimeIntervalEntry
getTimeInterval
in interface TimeIntervalEntry
public java.lang.String toString()
toString
in class java.lang.Object