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
Property | Data Type | Description |
start | Date | Beginning of time span, including this start point. |
end | Date | Ending of time span, excluding this end point. |
priority | Integer | Distinguishes spans by arbitrary priority. |
Methods
All of the methods of DateSpan, plus the following:
PrioDateSpan.make(priority, start, end) |
Argument | Data Type | Description |
priority | Integer | Arbitrary priority |
start | Date | Span start timestamp, inclusive |
end | Date | Span end timestamp, exclusive |
returns | DateSpan | A span with the given
properties, optimized if possible. |
span.after(arg0) |
Argument | Data Type | Description |
arg0 | Date DateSpan DateSpans | Subject date |
returns | boolean | True 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) |
Argument | Data Type | Description |
arg0 | Date DateSpan DateSpans | Subject date |
returns | boolean | True 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) |
Argument | Data Type | Description |
arg0 | DateSpan | Comparison subject |
returns | int | Implements natural ordering for
DateSpan objects, which will sort by ascending start point and
descending end point. |
span.contains(arg0) |
Argument | Data Type | Description |
arg0 | Date DateSpan DateSpans | Subject date |
returns | boolean | True 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) |
Argument | Data Type | Description |
arg0 | DateSpan | Subject datespan |
returns | boolean | True if the datespan is entirely
contained within the subject datespan. |
span.intersect(arg0) |
Argument | Data Type | Description |
arg0 | DateSpan DateSpans | Subject datespan(s) |
returns | boolean | True if any part of this datespan
contains any part of the subject datespan or composite datespans. |
span.outer(arg0) |
Argument | Data Type | Description |
arg0 | DateSpan | Subject datespan |
returns | DateSpan | The smallest Datespan that
contains both this span and the subject span. |
span.overlap(arg0) |
Argument | Data Type | Description |
arg0 | DateSpan | Subject datespan |
returns | DateSpan | The intersection of
of this span and the subject span, or null/None if no overlap. |