Class Timeline
java.lang.Object
com.inductiveautomation.ignition.common.util.TimelineList<Object>
com.inductiveautomation.ignition.common.util.Timeline
- All Implemented Interfaces:
- Serializable
A timeline is a simple list of time segments. It is used to determine coverage, and its segments do not contain
 values. If values should be associated with time, use 
TimelineList.
 Note: this also overrides some functions to provide correct support for TimeOfDay style values (ie, times, not full dates). Specifically, that means that functions like getClosest, nextEvent, getSegment, will roll over to the earliest time if necessary. As a consequence, anyone calling these should note whether the return is earlier than the requested time, and accordingly adjust their calculations by 1 day.
- See Also:
- 
Nested Class SummaryNested ClassesModifier and TypeClassDescriptionprotected static classprotected static classstatic interfacestatic enumprotected static classNested classes/interfaces inherited from class com.inductiveautomation.ignition.common.util.TimelineListTimelineList.TimeSegment
- 
Field SummaryFields
- 
Constructor SummaryConstructorsConstructorDescriptionTimeline()Timeline(Timeline.TimelineStyle style) Specifies the style of timeline that this is (in other words, what the times represent).
- 
Method SummaryModifier and TypeMethodDescriptionvoidaddSegment(long start, long end) Adds a segment for the specified start and end times.static Timeline.TimelineParsergetClosest(long time) Returns the value for the given time, or the next defined value.getSegment(long time, boolean allowClosest) Returns the segment that contains the time.getStyle()Returns the style defined for this timelineinvert()Returns a timeline whose elements cover the inverse of the source timeline.longnextEvent(long time) Returns the next time that something interesting happens after the given time.Methods inherited from class com.inductiveautomation.ignition.common.util.TimelineListadd, add, add, add, covered, get, get, getSegment, getSegment, getSegments, indexOf, mergeSegments, nextEvent, size, sort, toString
- 
Field Details- 
style
 
- 
- 
Constructor Details- 
Timelinepublic Timeline()
- 
TimelineSpecifies the style of timeline that this is (in other words, what the times represent).
 
- 
- 
Method Details- 
getStyleReturns the style defined for this timeline
- 
addSegmentpublic void addSegment(long start, long end) Adds a segment for the specified start and end times.
- 
getSegmentDescription copied from class:TimelineListReturns the segment that contains the time. If allowClosest is true, will return the next possible time, if a time segment doesn't cover the current time.- Overrides:
- getSegmentin class- TimelineList<Object>
 
- 
getClosestDescription copied from class:TimelineListReturns the value for the given time, or the next defined value. Returns null if there is no value specified at, or beyond, the given time.- Overrides:
- getClosestin class- TimelineList<Object>
 
- 
nextEventpublic long nextEvent(long time) Description copied from class:TimelineListReturns the next time that something interesting happens after the given time. That is, the current segment ends, the next one starts, etc. If nothing else happens, Long.Max is returned.- Overrides:
- nextEventin class- TimelineList<Object>
 
- 
createParser
- 
invertReturns a timeline whose elements cover the inverse of the source timeline.
 
-