Class SpanSet<T>
- All Implemented Interfaces:
Base
,Collection
,TemporalObject
- Direct Known Subclasses:
datespanset
,FloatSpanSet
,IntSpanSet
,tstzspanset
- Author:
- ARIJIT SAMAL
-
Field Summary
Modifier and TypeFieldDescriptionprivate jnr.ffi.Pointer
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionReturns the WKB representation in hex-encoded ASCII.jnr.ffi.Pointer
as_wkb()
Returns the WKB representationboolean
Returns whether "this" contains "other".jnr.ffi.Pointer
copy()
Returns the copy of a spanabstract jnr.ffi.Pointer
createInner
(jnr.ffi.Pointer inner) abstract jnr.ffi.Pointer
createStringInner
(String str) private void
Returns the distance between "this" and "other".Returns the last span in "this".boolean
Return whether "this" and "other" are equal.static <T> T
from_hexwkb
(String hexwkb, Class<T> spansetType) Returns a `TsTzSpan` from its WKB representation in hex-encoded ASCII.<T> T
Returns a `TsTzSpan` from its WKB representation.abstract jnr.ffi.Pointer
private long
getPointerSize
(Class<?> spanType) boolean
greaterThan
(Base other) Return whether "this" is greater than "other".boolean
greaterThanOrEqual
(Base other) Return whether "this" is greater than or equal to "other".long
hash()
Return the hash representation of "this".protected Base
intersection
(Base other) Returns the intersection of "this" and "other".boolean
is_adjacent
(Base other) Returns whether "this" is adjacent to "other".boolean
is_contained_in
(Base other) Returns whether "this" is contained in "other".boolean
Returns whether "this" is strictly to the left of "other".boolean
is_over_or_left
(Base other) Returns whether "this" is to the left of "other" allowing overlap.boolean
is_over_or_right
(Base other) Returns whether "this" is to the right of "other" allowing overlap.boolean
Returns whether "this" is strictly after "other".boolean
Returns whether the bounding span of "this" is the same as the bounding span of "other".boolean
Return whether "this" is less than "other".boolean
lessThanOrEqual
(Base other) Return whether "this" is less than or equal to "other".protected Base
Returns the temporal difference of ``self`` and ``other``.boolean
Return whether "this" and "other" are not equal.int
Returns the number of spans in "this".boolean
Returns whether "this" overlaps "other".Returns the n-th span in "this".<T> List
<T> Returns the list of tstzspans in ``this``.start_span
(Class<T> start_span) <T> T
Returns a tstzspan set containing spanprotected Base
Returns the temporal union of "this" and "other".
-
Field Details
-
_inner
private jnr.ffi.Pointer _inner -
POINTER_SIZES
-
-
Constructor Details
-
SpanSet
public SpanSet()------------------------- Constructor ----------------------------------- -
SpanSet
public SpanSet(jnr.ffi.Pointer inner) -
SpanSet
-
-
Method Details
-
get_inner
public abstract jnr.ffi.Pointer get_inner() -
createInner
public abstract jnr.ffi.Pointer createInner(jnr.ffi.Pointer inner) -
createStringInner
-
copy
public jnr.ffi.Pointer copy()Returns the copy of a span- Returns:
- Pointer type
-
from_wkb
public <T> T from_wkb(jnr.ffi.Pointer wkb, long size, Class<T> spansetType) throws NoSuchMethodException, InvocationTargetException, InstantiationException, IllegalAccessException Returns a `TsTzSpan` from its WKB representation.- Returns:
- Pointer type
- Throws:
NoSuchMethodException
InvocationTargetException
InstantiationException
IllegalAccessException
-
from_hexwkb
public static <T> T from_hexwkb(String hexwkb, Class<T> spansetType) throws NoSuchMethodException, InvocationTargetException, InstantiationException, IllegalAccessException Returns a `TsTzSpan` from its WKB representation in hex-encoded ASCII.- Returns:
- T type
- Throws:
NoSuchMethodException
InvocationTargetException
InstantiationException
IllegalAccessException
-
as_wkb
public jnr.ffi.Pointer as_wkb()Returns the WKB representation- Returns:
- Pointer type
-
as_hexwkb
Returns the WKB representation in hex-encoded ASCII.- Returns:
- String type
-
to_span
public <T> T to_span(Class<T> spansetType) throws NoSuchMethodException, InvocationTargetException, InstantiationException, IllegalAccessException Returns a tstzspan set containing span- Returns:
- String type
- Throws:
NoSuchMethodException
InvocationTargetException
InstantiationException
IllegalAccessException
-
num_spans
public int num_spans()Returns the number of spans in "this".MEOS Functions:
- spanset_num_spans
- Returns:
- An
Integer
-
start_span
public T start_span(Class<T> start_span) throws NoSuchMethodException, InvocationTargetException, InstantiationException, IllegalAccessException -
end_span
public T end_span(Class<T> end_span) throws NoSuchMethodException, InvocationTargetException, InstantiationException, IllegalAccessException Returns the last span in "this".MEOS Functions:
- spanset_end_span
- Returns:
- A
Span
instance - Throws:
NoSuchMethodException
InvocationTargetException
InstantiationException
IllegalAccessException
-
span_n
public T span_n(Class<T> span_n, int n) throws NoSuchMethodException, InvocationTargetException, InstantiationException, IllegalAccessException Returns the n-th span in "this".MEOS Functions:
- spanset_span_n
- Parameters:
n
- number of Span- Returns:
- A
Span
instance - Throws:
NoSuchMethodException
InvocationTargetException
InstantiationException
IllegalAccessException
-
getPointerSize
-
spans
public <T> List<T> spans(Class<T> spanType) throws NoSuchMethodException, IllegalAccessException, InvocationTargetException, InstantiationException, InvocationTargetException Returns the list of tstzspans in ``this``. Returns: A :class:`list[TsTzSpan]` instance MEOS Functions: spanset_spans -
hash
public long hash()Return the hash representation of "this".MEOS Functions:
- spanset_hash
- Returns:
- A new :class:`int` instance
-
is_adjacent
Returns whether "this" is adjacent to "other". That is, they share a bound but only one of them contains it.MEOS Functions:
- adjacent_spanset_span
- adjacent_spanset_spanset
- Parameters:
other
- object to compare with- Returns:
- True if adjacent, False otherwise
- Throws:
Exception
-
is_contained_in
Returns whether "this" is contained in "other".MEOS Functions:
- contained_spanset_span
- contained_spanset_spanset
- Specified by:
is_contained_in
in interfaceCollection<T>
- Parameters:
other
- temporal object to compare with- Returns:
- True if contained, False otherwise
- Throws:
Exception
-
contains
Returns whether "this" contains "other".MEOS Functions:
- contains_spanset_span
- contains_spanset_spanset
- Specified by:
contains
in interfaceCollection<T>
- Parameters:
other
- temporal object to compare with- Returns:
- True if contains, False otherwise
- Throws:
Exception
-
overlaps
Returns whether "this" overlaps "other". That is, both share at least an instant.MEOS Functions:
- overlaps_spanset_span
- overlaps_spanset_spanset
- Specified by:
overlaps
in interfaceCollection<T>
- Parameters:
other
- temporal object to compare with- Returns:
- True if overlaps, False otherwise
- Throws:
Exception
-
is_same
Returns whether the bounding span of "this" is the same as the bounding span of "other".- Parameters:
other
- A time or temporal object to compare to "this".- Returns:
- True if same, False otherwise.
- Throws:
Exception
-
is_left
Returns whether "this" is strictly to the left of "other". That is, "this" ends before "other" starts.MEOS Functions:
- before_periodset_timestamp
- left_spanset_span
- left_spanset_spanset
- Specified by:
is_left
in interfaceCollection<T>
- Parameters:
other
- temporal object to compare with- Returns:
- True if before, False otherwise
- Throws:
Exception
-
is_over_or_left
Returns whether "this" is to the left of "other" allowing overlap. That is, "this" ends before "other" ends (or at the same time).MEOS Functions:
- overleft_spanset_span
- overleft_spanset_spanset
- Specified by:
is_over_or_left
in interfaceCollection<T>
- Parameters:
other
- temporal object to compare with- Returns:
- True if before, False otherwise
- Throws:
Exception
-
is_right
Returns whether "this" is strictly after "other". That is, "this" starts after "other" ends.MEOS Functions:
- right_spanset_span
- right_spanset_spanset
- Specified by:
is_right
in interfaceCollection<T>
- Parameters:
other
- temporal object to compare with- Returns:
- True if after, False otherwise
- Throws:
Exception
-
is_over_or_right
Returns whether "this" is to the right of "other" allowing overlap. That is, "this" starts after "other" starts (or at the same time).MEOS Functions:
- overright_spanset_span
- overright_spanset_spanset
- Specified by:
is_over_or_right
in interfaceCollection<T>
- Parameters:
other
- temporal object to compare with- Returns:
- True if overlapping or after, False otherwise
- Throws:
Exception
-
distance
Returns the distance between "this" and "other".MEOS Functions:
- distance_spanset_span
- distance_spanset_spanset
- Parameters:
other
- object to compare with- Throws:
Exception
-
intersection
Returns the intersection of "this" and "other".MEOS Functions:
- intersection_spanset_spanset
- intersection_spanset_span
- Parameters:
other
- object to intersect with- Returns:
- A collection instance. The actual class depends on "other".
- Throws:
Exception
-
minus
Returns the temporal difference of ``self`` and ``other``.MEOS Functions:
- minus_spanset_span
- minus_spanset_spanset
- Throws:
Exception
-
mul
- Throws:
Exception
-
sub
- Throws:
Exception
-
union
Returns the temporal union of "this" and "other".MEOS Functions:
- union_periodset_timestamp
- union_spanset_spanset
- union_spanset_span
- Throws:
Exception
-
add
- Throws:
Exception
-
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_neq
- 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:
Exception
-
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:
Exception
-
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:
Exception
-
greaterThanOrEqual
Return whether "this" 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:
Exception
-