Class Span<T>
- All Implemented Interfaces:
Base
,Collection
,TemporalObject
- Author:
- ARIJIT SAMAL
-
Field Summary
-
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 "content".Returns the copy of a spanabstract jnr.ffi.Pointer
createInner
(jnr.ffi.Pointer inner) abstract jnr.ffi.Pointer
createIntInt
(Number lower, Number upper, boolean lower_inc, boolean upper_inc) abstract jnr.ffi.Pointer
createIntIntNb
(Number lower, Number upper) abstract jnr.ffi.Pointer
createIntStr
(Number lower, String upper, boolean lower_inc, boolean upper_inc) abstract jnr.ffi.Pointer
createStringInner
(String str) abstract jnr.ffi.Pointer
createStrInt
(String lower, Number upper, boolean lower_inc, boolean upper_inc) abstract jnr.ffi.Pointer
createStrStr
(String lower, String upper, boolean lower_inc, boolean upper_inc) private void
Returns the distance between "this" and "other".boolean
Return whether "this" and "other" are equal.static <T> T
from_hexwkb
(String hexwkb, Class<T> spanType) Returns a `TsTzSpan` from its WKB representation in hex-encoded ASCII.<T> T
Returns a `TsTzSpan` from its WKB representation.abstract jnr.ffi.Pointer
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".private 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 "container".boolean
Returns whether "this" is strictly before "other".boolean
is_over_or_left
(Base other) Returns whether "this" is before "other" allowing overlap.boolean
is_over_or_right
(Base other) Returns whether "this" is after "other" allowing overlap.boolean
Returns whether "this" is strictly after "other".boolean
boolean
Return whether "this" is less than "other".boolean
lessThanOrEqual
(Base other) Return whether "this" is less than or equal to "other".abstract T
lower()
Returns the lower bound of a periodboolean
Returns whether the lower bound of the period is inclusive or notprotected Base
boolean
Return whether "this" and "other" are not equal.boolean
Returns whether "this" overlaps "other".<T> T
to_spanset
(Class<T> spansetType) Returns a tstzspan set containing spanprotected Base
Returns the temporal union of "this" and "other".abstract T
upper()
Returns the upper bound of a periodboolean
Returns whether the upper bound of the period is inclusive or notfloat
width()
Returns the duration of the period.
-
Field Details
-
_inner
private jnr.ffi.Pointer _inner
-
-
Constructor Details
-
Span
public Span()------------------------- Constructors ---------------------------------- -
Span
public Span(jnr.ffi.Pointer inner) -
Span
-
Span
-
Span
-
Span
-
Span
-
Span
-
-
Method Details
-
get_inner
public abstract jnr.ffi.Pointer get_inner() -
createInner
public abstract jnr.ffi.Pointer createInner(jnr.ffi.Pointer inner) -
createStringInner
-
createIntInt
-
createIntStr
-
createStrStr
-
createStrInt
-
createIntIntNb
-
lower
Returns the lower bound of a period- Returns:
- T type
-
upper
Returns the upper bound of a period- Returns:
- T type
-
copy
public T copy(Class<T> span) throws NoSuchMethodException, InvocationTargetException, InstantiationException, IllegalAccessException Returns the copy of a span- Returns:
- Pointer type
- Throws:
NoSuchMethodException
InvocationTargetException
InstantiationException
IllegalAccessException
-
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> spanType) 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_spanset
public <T> T to_spanset(Class<T> spansetType) throws NoSuchMethodException, InvocationTargetException, InstantiationException, IllegalAccessException Returns a tstzspan set containing span- Returns:
- String type
- Throws:
NoSuchMethodException
InvocationTargetException
InstantiationException
IllegalAccessException
-
lower_inc
public boolean lower_inc()Returns whether the lower bound of the period is inclusive or notMEOS Functions:
- span_lower_inc
- Returns:
- True if the lower bound of the period is inclusive and False otherwise
-
upper_inc
public boolean upper_inc()Returns whether the upper bound of the period is inclusive or notMEOS Functions:
- span_upper_inc
- Returns:
- True if the upper bound of the period is inclusive and False otherwise
-
width
public float width()Returns the duration of the period.MEOS Functions:
- span_width
- Returns:
- Returns a
Float
representing the duration of the period in seconds
-
hash
public long hash()Return the hash representation of "this".MEOS Functions:
- span_hash
- Returns:
- A new
Integer
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_span_span
- adjacent_span_spanset
- Parameters:
other
- object to compare with- Returns:
- True if adjacent, False otherwise
- Throws:
Exception
-
is_contained_in
Returns whether "this" is contained in "container".MEOS Functions:
- contained_span_span
- contained_span_spanset
- contained_period_temporal
- 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 "content".MEOS Functions:
- contains_span_span
- contains_span_spanset
- contains_period_timestamp
- contains_period_timestampset
- contains_period_temporal
- 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 element.MEOS Functions:
- overlaps_span_span
- overlaps_span_spanset
- Specified by:
overlaps
in interfaceCollection<T>
- Parameters:
other
- temporal object to compare with- Returns:
- True if overlaps, False otherwise
- Throws:
Exception
-
is_same
- Throws:
Exception
-
is_left
Returns whether "this" is strictly before "other". That is, "this" ends before "other" starts.MEOS Functions:
- left_span_span
- left_span_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 before "other" allowing overlap. That is, "this" ends before "other" ends (or at the same time).MEOS Functions:
- overleft_span_span
- overleft_span_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_span_span
- right_span_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 after "other" allowing overlap. That is, "this" starts after "other" starts (or at the same time).MEOS Functions:
- overright_span_span
- overright_span_spanset
- overafter_period_timestamp
- overafter_period_timestampset
- overafter_period_temporal
- 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_span_span
- distance_spanset_span
- Parameters:
other
- object to compare with- Throws:
Exception
-
intersection
Returns the intersection of "this" and "other".MEOS Functions:
- intersection_span_span
- intersection_spanset_span
- intersection_period_timestamp
- Parameters:
other
- object to intersect with- Returns:
- A collection instance. The actual class depends on ``other``.
- Throws:
Exception
-
mul
- Throws:
Exception
-
minus
- Throws:
Exception
-
union
Returns the temporal union of "this" and "other".MEOS Functions:
- union_period_timestamp
- union_spanset_span
- union_span_span
- Parameters:
other
- temporal object to merge with- Throws:
Exception
-
add
- Throws:
Exception
-
eq
Return whether "this" and "other" are equal.MEOS Functions:
- span_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:
- span_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:
- span_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:
- span_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:
- span_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:
- span_ge
- Parameters:
other
- temporal object to compare with- Returns:
- True if greater than or equal, False otherwise
- Throws:
Exception
-