Package types.collections.time
Class tstzset
- All Implemented Interfaces:
Base
,Collection
,Time
,TimeCollection
,TemporalObject
Class for representing lists of distinct timestamp values.
``tstzset`` objects can be created with a single argument of type string as in MobilityDB. >>> tstzset(string='{2019-09-08 00:00:00+01, 2019-09-10 00:00:00+01, 2019-09-11 00:00:00+01}') Another possibility is to give a tuple or list of composing timestamps, which can be instances of ``str`` or ``datetime``. The composing timestamps must be given in increasing order. >>> tstzset(timestamp_list=['2019-09-08 00:00:00+01', '2019-09-10 00:00:00+01', '2019-09-11 00:00:00+01']) >>> tstzset(timestamp_list=[parse('2019-09-08 00:00:00+01'), parse('2019-09-10 00:00:00+01'), parse('2019-09-11 00:00:00+01')])
- Author:
- Arijit Samal
-
Field Summary
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionReturns the temporal union of "this" and "other".boolean
contains
(TemporalObject other) Returns whether "this" temporally contains "other".jnr.ffi.Pointer
createInner
(jnr.ffi.Pointer inner) jnr.ffi.Pointer
createStringInner
(String str) duration()
element_n
(int n) Returns the n-th element in "this".elements()
Returns the last timestamp in "this".static tstzset
from_hexwkb
(String hexwkb) Returns a "tstzset" from its WKB representation in hex-encoded ASCII.jnr.ffi.Pointer
------------------------- Accessors -------------------------------------long
hash()
Return the hash representation of "this".intersection
(TemporalObject other) Returns the temporal intersection of "this" and "other".boolean
is_adjacent
(TemporalObject other) Returns whether "this" is temporally adjacent to "other".boolean
is_after
(TemporalObject other) Returns whether "this" is strictly after "other".boolean
is_before
(TemporalObject other) Returns whether "this" is strictly before "other".boolean
is_contained_in
(TemporalObject other) Returns whether "this" is temporally contained in "other".boolean
is_over_or_after
(TemporalObject other) Returns whether "this" is after "other" allowing overlap.boolean
is_over_or_before
(TemporalObject other) Returns whether "this" is before "other" allowing overlap.boolean
Returns whether the bounding period of "this" is the same as the bounding period of "other".minus
(TemporalObject other) Returns the temporal difference of "this" and "other".mul
(TemporalObject other) Returns the temporal intersection of "this" and "other".int
Returns the number of timestamps in "this".boolean
overlaps
(TemporalObject other) Returns whether "this" temporally overlaps "other".shift_scale
(Integer shift, Integer duration) Returns the first timestamp in "this".Returns the temporal difference of "this" and "other".Returns a period that encompasses "this".Returns a tstzspanset that contains a tstzspan for each Timestamp in "this".to_span()
Returns a period that encompasses "this".toString()
Return the string representation of the content of "this".union
(TemporalObject other) Returns the temporal union of "this" and "other".Methods inherited from class types.collections.base.Set
add, as_hexwkb, as_wkb, contains, copy, elements, eq, from_hexwkb, from_wkb, greaterThan, greaterThanOrEqual, is_adjacent, is_contained_in, is_left, is_over_or_left, is_over_or_right, is_right, length, lessThan, lessThanOrEqual, mul, notEquals, num_elements, overlaps, rsub, sub, subtract_from, to_span, to_spanset
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
Methods inherited from interface types.collections.base.Collection
contains, is_contained_in, is_left, is_over_or_left, is_over_or_right, is_right, overlaps
Methods inherited from interface types.collections.time.TimeCollection
is_after, is_before, is_over_or_after, is_over_or_before
-
Field Details
-
dateTimeList
-
_inner
private jnr.ffi.Pointer _inner
-
-
Constructor Details
-
tstzset
public tstzset()The default constructor -
tstzset
public tstzset(jnr.ffi.Pointer _inner) Pointer constructor- Parameters:
_inner
- Pointer
-
tstzset
The string constructor- Parameters:
value
- - a string with a tstzset value
-
-
Method Details
-
createStringInner
- Specified by:
createStringInner
in classSet<LocalDateTime>
-
createInner
public jnr.ffi.Pointer createInner(jnr.ffi.Pointer inner) - Specified by:
createInner
in classSet<LocalDateTime>
-
from_hexwkb
Returns a "tstzset" from its WKB representation in hex-encoded ASCII.MEOS Functions:
- set_from_hexwkb
- Parameters:
hexwkb
- WKB representation in hex-encoded ASCII- Returns:
- a new tstzset instance
-
toString
Return the string representation of the content of "this".MEOS Functions:
- set_out
-
to_periodset
Returns a tstzspanset that contains a tstzspan for each Timestamp in "this".MEOS Functions:
- set_to_spanset
- Returns:
- a new tstzspanset instance
-
to_span
Returns a period that encompasses "this".MEOS Functions:
- set_span
- Returns:
- a new tstzspan instance
-
to_spanset
-
to_period
Returns a period that encompasses "this".MEOS Functions:
- set_span
- Returns:
- a new tstzspan instance
-
duration
-
get_inner
public jnr.ffi.Pointer get_inner()------------------------- Accessors -------------------------------------- Specified by:
get_inner
in classSet<LocalDateTime>
-
num_timestamps
public int num_timestamps()Returns the number of timestamps in "this".MEOS Functions:
- set_num_values
- Returns:
- a new Integer instance
-
start_element
Returns the first timestamp in "this".MEOS Functions:
- timestampset_start_timestamp
- Specified by:
start_element
in classSet<LocalDateTime>
- Returns:
- a
instance
-
end_element
Returns the last timestamp in "this".MEOS Functions:
- timestampset_end_timestamp
- Specified by:
end_element
in classSet<LocalDateTime>
- Returns:
- a
instance
-
element_n
Description copied from class:Set
Returns the n-th element in "this".- Overrides:
element_n
in classSet<LocalDateTime>
- Parameters:
n
- the n-th element- Returns:
- A
Set
instance - Throws:
Exception
-
elements
- Throws:
Exception
-
scale
-
shift
-
shift_scale
-
hash
public long hash()Return the hash representation of "this".MEOS Functions:
- set_hash
- Overrides:
hash
in classSet<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: >>> tstzset('{2012-01-01, 2012-01-02}').is_adjacent(tstzspan('[2012-01-02, 2012-01-03]')) >>> True >>> tstzset('{2012-01-01, 2012-01-02}').is_adjacent(tstzspan('[2012-01-02, 2012-01-03]')) >>> False # Both contain bound >>> tstzset('{2012-01-01, 2012-01-02}').is_adjacent(tstzspan('(2012-01-02, 2012-01-03]')) >>> False # Neither contain bound
MEOS Functions:- adjacent_span_span
- adjacent_spanset_span
- 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: >>> tstzset('{2012-01-02, 2012-01-03}').is_contained_in(tstzspan('[2012-01-01, 2012-01-04]')) >>> True >>> tstzset('{2012-01-01, 2012-01-02}').is_contained_in(tstzspan('[2012-01-01, 2012-01-02]')) >>> True >>> tstzset('{2012-01-01, 2012-01-02}').is_contained_in(tstzspan('(2012-01-01, 2012-01-02)')) >>> False
MEOS Functions:- contained_span_span
- contained_span_spanset
- contained_set_set
- contained_spanset_spanset
- Parameters:
other
- temporal object to compare with- Returns:
- true if contained, false otherwise
- Throws:
Exception
-
contains
Returns whether "this" temporally contains "other".Examples: >>> tstzset('{2012-01-01, 2012-01-04}').contains(parse('2012-01-01]')) >>> True >>> tstzset('{2012-01-01, 2012-01-02}').contains(tstzset('{2012-01-01}')) >>> True >>> tstzset('{2012-01-01, 2012-01-02}').contains(tstzset('{2012-01-01, 2012-01-03}')) >>> False
MEOS Functions:- contains_timestampset_timestamp
- contains_set_set
- contains_spanset_spanset
- 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: >>> tstzset('{2012-01-01, 2012-01-02}').overlaps(tstzset('{2012-01-02, 2012-01-03}')) >>> True >>> tstzset('{2012-01-01, 2012-01-02}').overlaps(tstzspan('[2012-01-02, 2012-01-03]')) >>> True >>> tstzset('{2012-01-01, 2012-01-02}').overlaps(tstzspan('(2012-01-02, 2012-01-03]')) >>> False
MEOS Functions:- overlaps_set_set
- overlaps_span_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 `self`.- Returns:
- true if same, false otherwise.
- Throws:
Exception
-
is_after
Returns whether "this" is strictly after "other". That is, the first timestamp in "this" is after "other".Examples: >>> tstzset('{2012-01-02, 2012-01-03}').is_after(tstzspan('[2012-01-01, 2012-01-02)')) >>> True >>> tstzset('{2012-01-02, 2012-01-03}').is_after(tstzset('{2012-01-01}')) >>> True >>> tstzset('{2012-01-02, 2012-01-03}').is_after(tstzspan('[2012-01-01, 2012-01-02]')) >>> False
MEOS Functions:- overbefore_timestamp_timestampset
- right_set_set
- right_span_span
- right_span_spanset
- Parameters:
other
- temporal object to compare with- Returns:
- true if after, false otherwise
- Throws:
Exception
-
is_before
Returns whether "this" is strictly before "other". That is, "this" ends before "other" starts.Examples: >>> tstzset('{2012-01-01, 2012-01-02}').is_before(tstzset('{2012-01-03}')) >>> True >>> tstzset('{2012-01-01, 2012-01-02}').is_before(tstzspan('(2012-01-02, 2012-01-03]')) >>> True >>> tstzset('{2012-01-01, 2012-01-02}').is_before(tstzspan('[2012-01-02, 2012-01-03]')) >>> False
MEOS Functions:- overafter_timestamp_period
- left_span_span
- left_span_spanset
- Parameters:
other
- : temporal object to compare with- Returns:
- true if before, 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: >>> tstzset('{2012-01-02, 2012-01-03}').is_over_or_after(tstzspan('[2012-01-01, 2012-01-02)')) >>> True >>> tstzset('{2012-01-02, 2012-01-03}').is_over_or_after(tstzspan('[2012-01-01, 2012-01-02]')) >>> True >>> tstzset('{2012-01-02, 2012-01-03}').is_over_or_after(tstzspan('[2012-01-01, 2012-01-03]')) >>> False
MEOS Functions:- overafter_period_timestamp
- overright_span_span
- overright_span_spanset
- Parameters:
other
- temporal object to compare with- Returns:
- true if overlapping or after, 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: >>> tstzset('{2012-01-01, 2012-01-02}').is_over_or_before(tstzspan('[2012-01-02, 2012-01-03]')) >>> True >>> tstzset('{2012-01-01, 2012-01-02}').is_over_or_before(tstzspan('[2012-01-02, 2012-01-03]')) >>> True >>> tstzset('{2012-01-03, 2012-01-05}').is_over_or_before(tstzspan('[2012-01-01, 2012-01-04]')) >>> False
MEOS Functions:- overbefore_period_timestamp
- overleft_span_span
- overleft_span_spanset
- Parameters:
other
- temporal object to compare with- Returns:
- true if before, false otherwise
- Throws:
Exception
-
distance
- Throws:
Exception
-
intersection
Returns the temporal intersection of "this" and "other". MEOS Functions:- intersection_set_set
- intersection_spanset_span
- intersection_spanset_spanset
- Parameters:
other
- temporal object to intersect with- Returns:
- a Time instance. The actual class depends on "other".
- Throws:
Exception
-
mul
Returns the temporal intersection of "this" and "other". MEOS Functions:- intersection_set_set
- intersection_spanset_span
- intersection_spanset_spanset
- Parameters:
other
- temporal object to intersect with- Returns:
- a Time instance. The actual class depends on "other".
- Throws:
Exception
-
minus
Returns the temporal difference of "this" and "other". MEOS Functions:- minus_timestampset_timestamp
- minus_set_set
- minus_spanset_span
- minus_spanset_spanset
- Parameters:
other
- temporal object to diff with- Returns:
- a Time instance. The actual class depends on "other".
- Throws:
Exception
-
sub
Returns the temporal difference of "this" and "other". MEOS Functions:- minus_timestampset_timestamp
- minus_set_set
- minus_spanset_span
- minus_spanset_spanset
- Parameters:
other
- temporal object to diff with- Returns:
- a Time instance. The actual class depends on "other".
- Throws:
Exception
-
union
Returns the temporal union of "this" and "other". MEOS Functions:- union_timestampset_timestamp
- union_set_set
- union_spanset_span
- union_spanset_spanset
- Parameters:
other
- temporal object to merge with- Returns:
- a Time instance. The actual class depends on "other".
- Throws:
Exception
-
add
Returns the temporal union of "this" and "other". MEOS Functions:- union_timestampset_timestamp
- union_set_set
- union_spanset_span
- union_spanset_spanset
- Parameters:
other
- temporal object to merge with- Returns:
- a Time instance. The actual class depends on "other".
- Throws:
Exception
-