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

PrioDateSpan

This composite type extends the DateSpan data type to include prioritization. The make() method should be used to instantiate instances instead of using the constructor in order to allow optimization of spans with max priority.

Syntax

from java.util import Date
from com.automation_pros.tsdbcache import PrioDateSpan
span = PrioDateSpan.make(priority, Date(...), Date(...))

Properties

PropertyData TypeDescription
startDateBeginning of time span, including this start point.
endDateEnding of time span, excluding this end point.
priorityIntegerDistinguishes spans by arbitrary priority.

Methods

All of the methods of DateSpan, plus the following:

PrioDateSpan.make(priority, start, end)
ArgumentData TypeDescription
priorityIntegerArbitrary priority
startDateSpan start timestamp, inclusive
endDateSpan end timestamp, exclusive
returnsDateSpanA span with the given properties, optimized if possible.
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.