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()
TimeIntervalstartTime in interface TimeIntervalpublic final long stopTime()
TimeIntervalstopTime in interface TimeIntervalpublic final long duration()
TimeIntervalduration in interface TimeIntervalpublic final boolean current()
TimeIntervalcurrent in interface TimeIntervalpublic final boolean current(long time)
TimeIntervalcurrent in interface TimeIntervalpublic final boolean equals(java.lang.Object other)
equals in interface java.util.Comparator<TimeInterval>equals in class java.lang.Objectpublic final int hashCode()
hashCode in class java.lang.Objectpublic final int compareTo(TimeInterval interval)
ComparableElementpublic 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)
ComparableElementComparableElement.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()
TimeIntervalEntrygetTimeInterval in interface TimeIntervalEntrypublic java.lang.String toString()
toString in class java.lang.Object