Class Span<T>
- All Implemented Interfaces:
Base,Collection,TemporalObject
- Author:
- ARIJIT SAMAL
-
Field Summary
Fields -
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 "content".Returns the copy of a spanabstract jnr.ffi.PointercreateInner(jnr.ffi.Pointer inner) abstract jnr.ffi.PointercreateIntInt(Number lower, Number upper, boolean lower_inc, boolean upper_inc) abstract jnr.ffi.PointercreateIntIntNb(Number lower, Number upper) abstract jnr.ffi.PointercreateIntStr(Number lower, String upper, boolean lower_inc, boolean upper_inc) abstract jnr.ffi.PointercreateStringInner(String str) abstract jnr.ffi.PointercreateStrInt(String lower, Number upper, boolean lower_inc, boolean upper_inc) abstract jnr.ffi.PointercreateStrStr(String lower, String upper, boolean lower_inc, boolean upper_inc) private voidReturns the distance between "this" and "other".booleanReturn whether "this" and "other" are equal.static <T> Tfrom_hexwkb(String hexwkb, Class<T> spanType) Returns a `TsTzSpan` from its WKB representation in hex-encoded ASCII.<T> TReturns a `TsTzSpan` from its WKB representation.abstract jnr.ffi.PointerbooleangreaterThan(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".private 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 "container".booleanReturns whether "this" is strictly before "other".booleanis_over_or_left(Base other) Returns whether "this" is before "other" allowing overlap.booleanis_over_or_right(Base other) Returns whether "this" is after "other" allowing overlap.booleanReturns whether "this" is strictly after "other".booleanbooleanReturn whether "this" is less than "other".booleanlessThanOrEqual(Base other) Return whether "this" is less than or equal to "other".abstract Tlower()Returns the lower bound of a periodbooleanReturns whether the lower bound of the period is inclusive or notprotected BasebooleanReturn whether "this" and "other" are not equal.booleanReturns whether "this" overlaps "other".<T> Tto_spanset(Class<T> spansetType) Returns a tstzspan set containing spanprotected BaseReturns the temporal union of "this" and "other".abstract Tupper()Returns the upper bound of a periodbooleanReturns whether the upper bound of the period is inclusive or notfloatwidth()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:
NoSuchMethodExceptionInvocationTargetExceptionInstantiationExceptionIllegalAccessException
-
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> spanType) 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_spanset
public <T> T to_spanset(Class<T> spansetType) throws NoSuchMethodException, InvocationTargetException, InstantiationException, IllegalAccessException Returns a tstzspan set containing span- Returns:
- String type
- Throws:
NoSuchMethodExceptionInvocationTargetExceptionInstantiationExceptionIllegalAccessException
-
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
Floatrepresenting the duration of the period in seconds
-
hash
public long hash()Return the hash representation of "this".MEOS Functions:
- span_hash
- Returns:
- A new
Integerinstance
-
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_inin 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:
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 element.MEOS Functions:
- overlaps_span_span
- overlaps_span_spanset
- Specified by:
overlapsin 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_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 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_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_span_span
- right_span_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 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_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_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
-