Class tstzspanset
- All Implemented Interfaces:
Base,Collection,Time,TimeCollection,TemporalObject
``tstzspanset`` objects can be created with a single argument of type string as in MobilityDB.
>>> tstzspanset(string='{[2019-09-08 00:00:00+01, 2019-09-10 00:00:00+01], [2019-09-11 00:00:00+01, 2019-09-12 00:00:00+01]}')
Another possibility is to give a list specifying the composing periods, which can be instances of ``str`` or ``tstzspan``. The composing periods must be given in increasing order.
>>> tstzspanset(period_list=['[2019-09-08 00:00:00+01, 2019-09-10 00:00:00+01]', '[2019-09-11 00:00:00+01, 2019-09-12 00:00:00+01]']) >>> tstzspanset(period_list=[tstzspan('[2019-09-08 00:00:00+01, 2019-09-10 00:00:00+01]'), tstzspan('[2019-09-11 00:00:00+01, 2019-09-12 00:00:00+01]')])
- Author:
- ARIJIT SAMAL
-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate jnr.ffi.Pointer -
Constructor Summary
ConstructorsConstructorDescriptionThe default constructortstzspanset(String value) The string constructortstzspanset(List<tstzspan> periods) The array of Periods constructortstzspanset(jnr.ffi.Pointer _inner) Pointer Constructor -
Method Summary
Modifier and TypeMethodDescriptionReturns the temporal union of "this" and "other".booleancontains(TemporalObject other) Returns whether ``self`` temporally contains ``content``.jnr.ffi.Pointercopy()Return a copy of "this".jnr.ffi.PointercreateInner(jnr.ffi.Pointer inner) jnr.ffi.PointercreateListInner(List<tstzspan> periods) jnr.ffi.PointercreateStringInner(String str) Returns the last period in "this".end_span()Returns the last period in "this".Returns the last timestamp in "this".booleanReturn whether "this" and "other" are equal.jnr.ffi.Pointerfrom_hexwkb(String str) Returns a "tstzspanset" from its WKB representation in hex-encoded ASCII.jnr.ffi.PointerReturns the C inner objectbooleangreaterThan(Time other) Return whether "this" is greater than "other".booleangreaterThanOrEqual(Time other) Return whether ``self`` is greater than or equal to ``other``.longhash()Return the hash representation of "this".intersection(Time other) Returns the temporal intersection of "this" and "other".booleanis_adjacent(TemporalObject other) Returns whether "this" is temporally adjacent to "other".booleanis_after(TemporalObject other) Returns whether "this" is strictly after "other".That is, "this" starts after "other" ends.booleanis_before(TemporalObject other) Returns whether "this" is strictly before "other".booleanis_contained_in(TemporalObject other) Returns whether "this" is temporally contained in "other".booleanis_over_or_after(TemporalObject other) Returns whether "this" is after "other" allowing overlap.booleanis_over_or_before(TemporalObject other) Returns whether "this" is before "other" allowing overlap.booleanis_same(TemporalObject other) Returns whether the bounding period of "this" is the same as the bounding period of "other".booleanReturn whether "this" is less than "other".booleanlessThanOrEqual(Time other) Return whether "this" is less than or equal to "other.Returns the temporal difference of "this" and "other".Returns the temporal intersection of "this" and "other".booleanReturn whether "this" and "other" are not equal.intReturns the number of periods in "this".intReturns the number of timestamps in "this".booleanoverlaps(TemporalObject other) Returns whether "this" temporally overlaps "other".Returns the first period in "this".Returns the first period in "this".Returns the first timestamp in "this".Returns the temporal difference of "this" and "other".timestamp_n(int n) Returns the nth timestamp of the tstzspansetReturns a period that encompasses "this".to_span()Returns a period that encompasses "this".toString()Return the string representation of the content of "this".Returns the temporal union of "this" and "other".Methods inherited from class types.collections.base.SpanSet
add, as_hexwkb, as_wkb, contains, end_span, eq, from_hexwkb, from_wkb, greaterThan, greaterThanOrEqual, intersection, is_adjacent, is_contained_in, is_left, is_over_or_left, is_over_or_right, is_right, is_same, lessThan, lessThanOrEqual, minus, mul, notEquals, num_spans, overlaps, span_n, spans, start_span, sub, to_span, unionMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitMethods inherited from interface types.collections.base.Collection
contains, is_contained_in, is_left, is_over_or_left, is_over_or_right, is_right, overlapsMethods inherited from interface types.collections.time.TimeCollection
is_after, is_before, is_over_or_after, is_over_or_before
-
Field Details
-
periodList
-
_inner
private jnr.ffi.Pointer _inner
-
-
Constructor Details
-
tstzspanset
public tstzspanset()The default constructor -
tstzspanset
public tstzspanset(jnr.ffi.Pointer _inner) Pointer Constructor- Parameters:
_inner- Pointer
-
tstzspanset
The string constructor- Parameters:
value- - a string with a tstzspanset value
-
tstzspanset
The array of Periods constructor- Parameters:
periods- - an array of Periods separated by a comma
-
-
Method Details
-
createStringInner
- Specified by:
createStringInnerin classSpanSet<LocalDateTime>
-
createInner
public jnr.ffi.Pointer createInner(jnr.ffi.Pointer inner) - Specified by:
createInnerin classSpanSet<LocalDateTime>
-
createListInner
-
copy
public jnr.ffi.Pointer copy()Return a copy of "this".Meos Functions:
- spanset_copy
- Overrides:
copyin classSpanSet<LocalDateTime>- Returns:
- a new tstzspanset instance
-
from_hexwkb
Returns a "tstzspanset" from its WKB representation in hex-encoded ASCII.MEOS Functions:
- spanset_from_hexwkb
- Parameters:
str- WKB representation in hex-encoded ASCII- Returns:
- a new tstzspanset instance
-
toString
Return the string representation of the content of "this".MEOS Functions:
- periodset_out
-
to_period
Returns a period that encompasses "this".MEOS Functions:
- spanset_span
- Returns:
- a new tstzspan instance
-
to_span
Returns a period that encompasses "this".MEOS Functions:
- spanset_span
- Returns:
- a new tstzspan instance
-
get_inner
public jnr.ffi.Pointer get_inner()Returns the C inner object- Specified by:
get_innerin classSpanSet<LocalDateTime>- Returns:
- the inner Pointer
-
num_timestamps
public int num_timestamps()Returns the number of timestamps in "this".MEOS Functions:
- periodset_num_timestamps
- Returns:
- an Integer instance
-
start_timestamp
Returns the first timestamp in "this".MEOS Functions:
- periodset_start_timestamp
- Returns:
- A
LocalDateTimeinstance
-
end_timestamp
Returns the last timestamp in "this".MEOS Functions:
- periodset_end_timestamp
- Returns:
- A
LocalDateTimeinstance
-
timestamp_n
Returns the nth timestamp of the tstzspanset- Parameters:
n- the nth element- Returns:
- Returns the nth timestamp of the tstzspanset
-
num_periods
public int num_periods()Returns the number of periods in "this".MEOS Functions:
- spanset_num_spans
- Returns:
- an Integer instance
-
start_period
Returns the first period in "this".MEOS Functions:
- periodset_lower
- Returns:
- a new tstzspan instance
-
start_span
Returns the first period in "this".MEOS Functions:
- periodset_lower
- Returns:
- a new tstzspan instance
-
end_period
Returns the last period in "this".MEOS Functions:
- periodset_upper
- Returns:
- a new tstzspan instance
-
end_span
Returns the last period in "this".MEOS Functions:
- periodset_upper
- Returns:
- a new tstzspan instance
-
hash
public long hash()Return the hash representation of "this".MEOS Functions:
- spanset_hash
- Overrides:
hashin classSpanSet<LocalDateTime>- Returns:
- a new Integer instance
-
is_adjacent
Returns whether "this" is temporally adjacent to "other". That is, they share a bound but only one of them contains it.Examples: >>> tstzspanset('{[2012-01-01, 2012-01-02)}').is_adjacent(tstzspanset('{[2012-01-02, 2012-01-03]}')) >>> True >>> tstzspanset('{[2012-01-01, 2012-01-02]}').is_adjacent(tstzspanset('{[2012-01-02, 2012-01-03]}')) >>> False # Both contain bound >>> tstzspanset('{[2012-01-01, 2012-01-02)}').is_adjacent(tstzspanset('{[(2012-01-02, 2012-01-03]]}')) >>> False # Neither contain boundMEOS Functions:- adjacent_spanset_span
- adjacent_spanset_spanset
- adjacent_periodset_timestamp
- adjacent_periodset_timestampset
- Parameters:
other- temporal object to compare with- Returns:
- True if adjacent, False otherwise
- Throws:
Exception
-
is_contained_in
Returns whether "this" is temporally contained in "other".Examples: >>> tstzspanset('{[2012-01-02, 2012-01-03]}').is_contained_in(tstzspan('{[2012-01-01, 2012-01-04]}')) >>> True >>> tstzspanset('{(2012-01-01, 2012-01-02)}').is_contained_in(tstzspan('{[2012-01-01, 2012-01-02]}')) >>> True >>> tstzspanset('{[2012-01-01, 2012-01-02]}').is_contained_in(tstzspan('{(2012-01-01, 2012-01-02)}')) >>> FalseMEOS Functions:- contained_spanset_span
- contained_spanset_spanset
- contained_periodset_temporal
- Parameters:
other- temporal object to compare with- Returns:
- True if contained, False otherwise
- Throws:
Exception
-
contains
Returns whether ``self`` temporally contains ``content``.Examples: >>> tstzspanset('{[2012-01-01, 2012-01-04]}').contains(tstzspanset('{[2012-01-02, 2012-01-03]}')) >>> True >>> tstzspanset('{[2012-01-01, 2012-01-02]}').contains(tstzspanset('{(2012-01-01, 2012-01-02)}')) >>> True >>> tstzspanset('{(2012-01-01, 2012-01-02)}').contains(tstzspanset('{[2012-01-01, 2012-01-02]}')) >>> FalseMEOS Functions:- contains_spanset_span
- contains_spanset_spanset
- contains_periodset_timestamp
- Parameters:
other- temporal object to compare with- Returns:
- True if contains, False otherwise
- Throws:
Exception
-
overlaps
Returns whether "this" temporally overlaps "other". That is, both share at least an instantExamples: >>> tstzspanset('{[2012-01-01, 2012-01-02]}').overlaps(tstzspanset('{[2012-01-02, 2012-01-03]}')) >>> True >>> tstzspanset('{[2012-01-01, 2012-01-02)}').overlaps(tstzspanset('{[2012-01-02, 2012-01-03]}')) >>> False >>> tstzspanset('{[2012-01-01, 2012-01-02)}').overlaps(tstzspanset('{(2012-01-02, 2012-01-03]}')) >>> FalseMEOS Functions:- overlaps_spanset_span
- overlaps_spanset_spanset
- Parameters:
other- temporal object to compare with- Returns:
- True if overlaps, False otherwise
- Throws:
Exception
-
is_same
Returns whether the bounding period of "this" is the same as the bounding period of "other".See Also:
tstzspan.is_same(TemporalObject)- Parameters:
other- A time or temporal object to compare to "this".- Returns:
- True if same, False otherwise.
- Throws:
Exception
-
is_before
Returns whether "this" is strictly before "other". That is, "this" ends before "other" starts.Examples: >>> tstzspanset('{[2012-01-01, 2012-01-02)}').is_before(tstzspanset('{[2012-01-02, 2012-01-03]}')) >>> True >>> tstzspanset('{[2012-01-01, 2012-01-02)}').is_before(tstzspanset('{(2012-01-02, 2012-01-03]}')) >>> True >>> tstzspanset('{[2012-01-01, 2012-01-02]}').is_before(tstzspanset('{[2012-01-02, 2012-01-03]}')) >>> FalseMEOS Functions:- before_periodset_timestamp
- left_spanset_span
- left_spanset_spanset
- Parameters:
other- temporal object to compare with- Returns:
- True if before, False otherwise
- Throws:
Exception
-
is_over_or_before
Returns whether "this" is before "other" allowing overlap. That is, "this" ends before "other" ends (or at the same time).Examples: >>> tstzspanset('{[2012-01-01, 2012-01-02)}').is_over_or_before(tstzspanset('{[2012-01-02, 2012-01-03]}')) >>> True >>> tstzspanset('{[2012-01-01, 2012-01-02]}').is_over_or_before(tstzspanset('{[2012-01-02, 2012-01-03]}')) >>> True >>> tstzspanset('{[2012-01-03, 2012-01-05]}').is_over_or_before(tstzspanset('{[2012-01-01, 2012-01-04]}')) >>> FalseMEOS Functions:- overleft_spanset_span
- overleft_spanset_spanset
- overbefore_periodset_timestamp
- overbefore_periodset_timestampset
- overbefore_periodset_temporal
- Parameters:
other- temporal object to compare with- Returns:
- True if before, False otherwise
- Throws:
Exception
-
is_after
Returns whether "this" is strictly after "other".That is, "this" starts after "other" ends.Examples: >>> tstzspanset('{[2012-01-02, 2012-01-03]}').is_after(tstzspanset('{[2012-01-01, 2012-01-02)}')) >>> True >>> tstzspanset('{(2012-01-02, 2012-01-03]}').is_after(tstzspanset('{[2012-01-01, 2012-01-02)}')) >>> True >>> tstzspanset('{[2012-01-02, 2012-01-03]}').is_after(tstzspanset('{[2012-01-01, 2012-01-02]}')) >>> FalseMEOS Functions:- right_spanset_span
- right_spanset_spanset
- overbefore_timestamp_periodset
- Parameters:
other- temporal object to compare with- Returns:
- True if after, False otherwise
- Throws:
Exception
-
is_over_or_after
Returns whether "this" is after "other" allowing overlap. That is, "this" starts after "other" starts (or at the same time).Examples: >>> tstzspanset('{[2012-01-02, 2012-01-03]}').is_over_or_after(tstzspanset('{[2012-01-01, 2012-01-02)}')) >>> True >>> tstzspanset('{[2012-01-02, 2012-01-03]}').is_over_or_after(tstzspanset('{[2012-01-01, 2012-01-02]}')) >>> True >>> tstzspanset('{[2012-01-02, 2012-01-03]}').is_over_or_after(tstzspanset('{[2012-01-01, 2012-01-03]}')) >>> FalseMEOS Functions:- overright_spanset_span
- overright_spanset_spanset
- overafter_periodset_timestamp
- overafter_periodset_timestampset
- Parameters:
other- temporal object to compare with- Returns:
- True if overlapping or after, False otherwise
- Throws:
Exception
-
intersection
Returns the temporal intersection of "this" and "other".MEOS Functions:
- intersection_periodset_timestamp
- intersection_spanset_spanset
- intersection_spanset_span
- Parameters:
other- temporal object to intersect with- Returns:
- a Time instance. The actual class depends on "other"
-
mul
Returns the temporal intersection of "this" and "other".MEOS Functions:
- intersection_periodset_timestamp
- intersection_spanset_spanset
- intersection_spanset_span
- Parameters:
other- temporal object to intersect with- Returns:
- a Time instance. The actual class depends on "other"
-
minus
Returns the temporal difference of "this" and "other".MEOS Functions:
- minus_spanset_span
- minus_spanset_spanset
- minus_periodset_timestamp
- Parameters:
other- temporal object to diff with- Returns:
- a tstzspanset instance
-
sub
Returns the temporal difference of "this" and "other".MEOS Functions:
- minus_spanset_span
- minus_spanset_spanset
- minus_periodset_timestamp
- Parameters:
other- temporal object to diff with- Returns:
- a tstzspanset instance
-
union
Returns the temporal union of "this" and "other".MEOS Functions:
- union_periodset_timestamp
- union_spanset_spanset
- union_spanset_span
- Parameters:
other- temporal object to merge with- Returns:
- a tstzspanset instance
-
add
Returns the temporal union of "this" and "other".MEOS Functions:
- union_periodset_timestamp
- union_spanset_spanset
- union_spanset_span
- Parameters:
other- temporal object to merge with- Returns:
- a tstzspanset instance
-
eq
Return whether "this" and "other" are equal.MEOS Functions:
- spanset_eq
- Parameters:
other- temporal object to compare with- Returns:
- True if equal, False otherwise
-
notEquals
Return whether "this" and "other" are not equal.MEOS Functions:
- spanset_ne
- Parameters:
other- temporal object to compare with- Returns:
- True if not equal, False otherwise
-
lessThan
Return whether "this" is less than "other".MEOS Functions:
- spanset_lt
- Parameters:
other- temporal object to compare with- Returns:
- True if less than, False otherwise
- Throws:
OperationNotSupportedException
-
lessThanOrEqual
Return whether "this" is less than or equal to "other.MEOS Functions:
- spanset_le
- Parameters:
other- temporal object to compare with- Returns:
- True if less than or equal, False otherwise
- Throws:
OperationNotSupportedException
-
greaterThan
Return whether "this" is greater than "other".MEOS Functions:
- spanset_gt
- Parameters:
other- temporal object to compare with- Returns:
- True if greater than, False otherwise
- Throws:
OperationNotSupportedException
-
greaterThanOrEqual
Return whether ``self`` is greater than or equal to ``other``.MEOS Functions:
- spanset_ge
- Parameters:
other- temporal object to compare with- Returns:
- True if greater than or equal, False otherwise
- Throws:
OperationNotSupportedException
-