public class SegmentedTimeSpan extends TimeSpan implements java.lang.Iterable<TimeSpan>
Constructor and Description |
---|
SegmentedTimeSpan(java.util.Date start,
java.util.Date stop)
Create a SegmentedTimeSpan from a TimeSpan.
|
SegmentedTimeSpan(TimeSpan span)
Create a SegmentedTimeSpan from a TimeSpan.
|
Modifier and Type | Method and Description |
---|---|
TimeSpan |
getContainingSegment(java.util.Date date)
return the segment containing the specified date.
|
TimeSpan |
getContainingSegment(TimeSpan span)
return the segment containing the start time of the span.
|
java.text.SimpleDateFormat |
getLabelFormat()
Get a DateFormat object which can be used to format labels for the
intervals
|
java.util.SortedSet<TimeSpan> |
getSegments()
Get the set of segments for this SegmentedTimeSpan
|
java.util.Date |
getSegmentStartDate()
Return the start date of the set of time segments
|
java.util.Date |
getSegmentStopDate()
Return the stop date of the set of time segments
|
java.util.Iterator<TimeSpan> |
iterator()
Convenience method for iterating over this SegmentedTimeSpan.
|
void |
setSegmentSize(long millis)
Set the segment size explicitly.
|
void |
setTimeInterval(int timeInterval)
Set the time interval explicitly.
|
compareTo, contains, equals, getDuration, getStartDate, getStopDate, hashCode, intersect, isInstantaneous, toString
public SegmentedTimeSpan(java.util.Date start, java.util.Date stop)
start
- the start time of the time spanstop
- the stop time of the time spanpublic SegmentedTimeSpan(TimeSpan span)
span
- the time span to use as the base for this SegmentedTimeSpanpublic TimeSpan getContainingSegment(java.util.Date date)
date
- the date to testpublic TimeSpan getContainingSegment(TimeSpan span)
span
- the time span to testpublic java.text.SimpleDateFormat getLabelFormat()
public java.util.SortedSet<TimeSpan> getSegments()
public java.util.Date getSegmentStartDate()
public java.util.Date getSegmentStopDate()
public java.util.Iterator<TimeSpan> iterator()
iterator
in interface java.lang.Iterable<TimeSpan>
public void setSegmentSize(long millis)
millis
- number of milliseconds in each time segmentpublic void setTimeInterval(int timeInterval)
timeInterval
- The Calendar interval to use for the segment size