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

DateSpan

This composite type describes a span of time based on an inclusive start time and an exclusive end time. Either or both timestamps may be null, indicating "unbounded" for that direction. A variety of comparison operations and composite operations are supplied as methods.

Syntax

from java.util import Date
from com.automation_pros.tsdbcache import DateSpan
span = DateSpan(Date(...), Date(...))

Properties

PropertyData TypeDescription
startDateBeginning of time span, including this start point.
endDateEnding of time span, excluding this end point.

Methods

DateSpan.dateToString(date)
ArgumentData TypeDescription
dateDatesubject date
returnsStringISO 8601 formatted date, with milliseconds
span.after(arg0)
ArgumentData TypeDescription
arg0Date
DateSpan
DateSpans
Subject date
returnsbooleanTrue if the datespan is after the subject date or datespan or composite datespans. Note that a subject datespan will be "after" if its start point is after or equal this datespan's end point.
span.before(arg0)
ArgumentData TypeDescription
arg0Date
DateSpan
DateSpans
Subject date
returnsbooleanTrue if the datespan is before the subject date or datespan or composite datespans. Note that a subject datespan will be "before" if its end point is before or equal this datespan's start point.
span.compareTo(arg0)
ArgumentData TypeDescription
arg0DateSpanComparison subject
returnsintImplements natural ordering for DateSpan objects, which will sort by ascending start point and descending end point.
span.contains(arg0)
ArgumentData TypeDescription
arg0Date
DateSpan
DateSpans
Subject date
returnsbooleanTrue if the datespan entirely contains the subject date or datespan or composite datespans. Note that a subject date must be before this datespan's end point, but a subject datespan may also have a matching end point.
span.inside(arg0)
ArgumentData TypeDescription
arg0DateSpanSubject datespan
returnsbooleanTrue if the datespan is entirely contained within the subject datespan.
span.intersect(arg0)
ArgumentData TypeDescription
arg0DateSpan
DateSpans
Subject datespan(s)
returnsbooleanTrue if any part of this datespan contains any part of the subject datespan or composite datespans.
span.outer(arg0)
ArgumentData TypeDescription
arg0DateSpanSubject datespan
returnsDateSpanThe smallest Datespan that contains both this span and the subject span.
span.overlap(arg0)
ArgumentData TypeDescription
arg0DateSpanSubject datespan
returnsDateSpanThe intersection of of this span and the subject span, or null/None if no overlap.