Class SpanSet<T>
- All Implemented Interfaces:
Base,Collection,TemporalObject
- Direct Known Subclasses:
datespanset,FloatSpanSet,IntSpanSet,tstzspanset
- Author:
- ARIJIT SAMAL
-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate jnr.ffi.Pointer -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionReturns the WKB representation in hex-encoded ASCII.jnr.ffi.Pointeras_wkb()Returns the WKB representationbooleanReturns whether "this" contains "other".jnr.ffi.Pointercopy()Returns the copy of a spanabstract jnr.ffi.PointercreateInner(jnr.ffi.Pointer inner) abstract jnr.ffi.PointercreateStringInner(String str) private voidReturns the distance between "this" and "other".Returns the last span in "this".booleanReturn whether "this" and "other" are equal.static <T> Tfrom_hexwkb(String hexwkb, Class<T> spansetType) Returns a `TsTzSpan` from its WKB representation in hex-encoded ASCII.<T> TReturns a `TsTzSpan` from its WKB representation.abstract jnr.ffi.Pointerprivate longgetPointerSize(Class<?> spanType) booleangreaterThan(Base other) Return whether "this" is greater than "other".booleangreaterThanOrEqual(Base other) Return whether "this" is greater than or equal to "other".longhash()Return the hash representation of "this".protected Baseintersection(Base other) Returns the intersection of "this" and "other".booleanis_adjacent(Base other) Returns whether "this" is adjacent to "other".booleanis_contained_in(Base other) Returns whether "this" is contained in "other".booleanReturns whether "this" is strictly to the left of "other".booleanis_over_or_left(Base other) Returns whether "this" is to the left of "other" allowing overlap.booleanis_over_or_right(Base other) Returns whether "this" is to the right of "other" allowing overlap.booleanReturns whether "this" is strictly after "other".booleanReturns whether the bounding span of "this" is the same as the bounding span of "other".booleanReturn whether "this" is less than "other".booleanlessThanOrEqual(Base other) Return whether "this" is less than or equal to "other".protected BaseReturns the temporal difference of ``self`` and ``other``.booleanReturn whether "this" and "other" are not equal.intReturns the number of spans in "this".booleanReturns 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> TReturns a tstzspan set containing spanprotected BaseReturns 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:
NoSuchMethodExceptionInvocationTargetExceptionInstantiationExceptionIllegalAccessException
-
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:
NoSuchMethodExceptionInvocationTargetExceptionInstantiationExceptionIllegalAccessException
-
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:
NoSuchMethodExceptionInvocationTargetExceptionInstantiationExceptionIllegalAccessException
-
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
Spaninstance - Throws:
NoSuchMethodExceptionInvocationTargetExceptionInstantiationExceptionIllegalAccessException
-
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
Spaninstance - Throws:
NoSuchMethodExceptionInvocationTargetExceptionInstantiationExceptionIllegalAccessException
-
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_inin 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:
containsin 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:
overlapsin 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_leftin 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_leftin 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_rightin 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_rightin 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
-