Time Series Database Cache Module by Automation Professionals
E-Mail Support

DateSpans

This composite type describes an ordered sequence of non-overlapping time spans, in the form of a list of DateSpan objects. The earliest DateSpan may have a null start timestamp, and the latest DateSpan may have a null end timestamp, each indicating "unbounded" in that direction. A variety of comparison operations, composite operations, and modification operations are supplied as methods.

Syntax

from java.util import Date
from com.automation_pros.tsdbcache import DateSpan, DateSpans
timeline = DateSpans()
timeline.add(DateSpan(Date(...), Date(...)))

Properties

PropertyData TypeDescription
spansList<DateSpan>Underlying list of DateSpans. Operations on this list are unchecked.

Methods

timeline.add(arg0)
ArgumentData TypeDescription
arg0DateSpan
DateSpans
Subject datespan(s)
returnsvoidMerge the subject datespan or composite datespans into this composite datespans.
timeline.intersect(arg0)
ArgumentData TypeDescription
arg0DateSpan
DateSpans
Subject datespan(s)
returnsbooleanTrue if any part of this composite datespans contains any part of the subject datespan or composite datespans.
timeline.isEmpty()
ArgumentData TypeDescription
returnsbooleanTrue if no time spans are present in the composite list.
timeline.outer()
ArgumentData TypeDescription
returnsDateSpanThe smallest Datespan that contains this entire composite datespans, or null/None if nothing present.
timeline.remove(arg0)
ArgumentData TypeDescription
arg0DateSpan
DateSpans
Subject datespan(s)
returnsvoidSubtract the subject datespan or composite datespans from this composite datespans, ignoring any fragments not present.