|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
public interface ITimeSpan
A time span encapsulates a start and an end time, making it easier to handle
objects that are placed on a timeline. Time spans implement the
Comparable
interface, which allows for easy sorting based on the
start time.
TimeSpanIterator
Method Summary | |
---|---|
boolean |
contains(ITimeSpan span)
Checks whether the time span contains the given time span. |
boolean |
endsAfter(ITimeSpan span)
Checks whether the given time span ends after this time span. |
boolean |
endsBefore(ITimeSpan span)
Checks whether the given time span ends before this time span. |
boolean |
equalDuration(ITimeSpan span)
Checks whether the given time span has exactly the same duration as this time span. |
boolean |
equals(ITimeSpan span)
Two time spans are considered equal if their start times and their end times are identical. |
long |
getDuration()
Calculates the total duration of this time span. |
long |
getEndTime()
Returns the time span's end time. |
long |
getStartTime()
Returns the time span's start time. |
boolean |
intersects(ITimeSpan span)
Checks whether the given time span intersects with this time span. |
boolean |
isActivity()
Determines whether this time span represents an activity. |
boolean |
isEvent()
Determines whether this time span represents an event. |
boolean |
isUndefined()
Checks whether this time span is undefined. |
ITimeSpan |
move(long delta)
Constructs a new time span based on this span where the given (delta) milliseconds are added to (or subtracted from if negative) the start and end time of this time span. |
boolean |
startsAfter(ITimeSpan span)
Checks whether the given time span starts after this time span. |
boolean |
startsBefore(ITimeSpan span)
Checks whether the given time span starts before this time span. |
java.lang.String |
toString(java.text.DateFormat format)
Returns a compact string representation of the time span. |
ITimeSpan |
union(ITimeSpan span)
The union of two time spans is a new time span, where the start time of the new span is the minimum start time and the end time is the maximum end time of the two spans. |
Methods inherited from interface java.lang.Comparable |
---|
compareTo |
Method Detail |
---|
long getStartTime()
getEndTime()
long getEndTime()
getStartTime()
boolean contains(ITimeSpan span)
span
- the time span to test for containment
intersects(ITimeSpan)
boolean endsAfter(ITimeSpan span)
span
- the time span to test
endsBefore(ITimeSpan)
boolean endsBefore(ITimeSpan span)
span
- the time span to test
endsAfter(ITimeSpan)
boolean equalDuration(ITimeSpan span)
span
- the time span to test
getDuration()
long getDuration()
equalDuration(ITimeSpan)
boolean intersects(ITimeSpan span)
span
- the time span to test for intersection
contains(ITimeSpan)
boolean isActivity()
isEvent()
boolean isEvent()
isEvent()
ITimeSpan move(long delta)
delta
- the amount of milliseconds to add to or subtract from the new
time span's start and end time
boolean startsAfter(ITimeSpan span)
span
- the time span to test
startsBefore(ITimeSpan)
boolean startsBefore(ITimeSpan span)
span
- the time span to test
startsAfter(ITimeSpan)
ITimeSpan union(ITimeSpan span)
isUndefined()
). If only one
of the spans is undefined then the other span becomes the result of the
union operation. If both of them are undefined then the result will be
undefined, too.
span
- the second time span for the union
boolean equals(ITimeSpan span)
span
- the time span to test
boolean isUndefined()
union(ITimeSpan)
first checks
whether the span on which the method gets called is undefined. If so and
the given second time span is not undefined then the result of the union
operation will be a copy of the second span).
java.lang.String toString(java.text.DateFormat format)
format
- the formatter used to create a date string
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |