Class IntSpan
- All Implemented Interfaces:
Base
,Collection
,Number
,TemporalObject
``IntSpan`` objects can be created with a single argument of type string as in MobilityDB.
>>> IntSpan('(2, 5]')
Another possibility is to provide the ``lower`` and ``upper`` named parameters (of type str or int), and optionally indicate whether the bounds are inclusive or exclusive (by default, the lower bound is inclusive and the upper is exclusive):
>>> IntSpan(lower=2, upper=5) >>> IntSpan(lower=2, upper=5, lower_inc=False, upper_inc=True) >>> IntSpan(lower='2', upper='5', upper_inc=True)
- Author:
- ARIJIT SAMAL
-
Field Summary
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionboolean
Returns whether "this" contains "content".copy()
Return a copy of "this".jnr.ffi.Pointer
createInner
(jnr.ffi.Pointer inner) jnr.ffi.Pointer
createIntInt
(Number lower, Number upper, boolean lower_inc, boolean upper_inc) jnr.ffi.Pointer
createIntIntNb
(Number lower, Number upper) jnr.ffi.Pointer
createIntStr
(Number lower, String upper, boolean lower_inc, boolean upper_inc) jnr.ffi.Pointer
createStringInner
(String str) jnr.ffi.Pointer
createStrInt
(String lower, Number upper, boolean lower_inc, boolean upper_inc) jnr.ffi.Pointer
createStrStr
(String lower, String upper, boolean lower_inc, boolean upper_inc) Returns the distance between "this" and "other".from_hexwkb
(String str) Returns a tstzspan from its WKB representation in hex-encoded ASCII.jnr.ffi.Pointer
------------------------- Accessors -------------------------------------intersection
(Object other) boolean
is_adjacent
(Object other) Returns whether "this" is adjacent to "other".boolean
Returns whether "this" is strictly before "other".boolean
is_over_or_left
(Object other) Returns whether "this" is before "other" allowing overlap.boolean
is_over_or_right
(Object other) Returns whether "this" is after "other" allowing overlap.boolean
Returns whether "this" is strictly after "other".boolean
Returns whether "this" and the bounding period of "other is the same.lower()
Returns the lower bound of "this".Returns the difference of "this" and "other".scale
(int width) Return a new "IntSpanSet" with the lower and upper bounds scaled so that the width is "width".shift
(int delta) Return a new "IntSpanSet" with the lower and upper bounds shifted by "delta".shift_scale
(int delta, int width) Return a new "IntSpanSet" with the lower and upper bounds shifted by "delta" and scaled so that the width is "width".Returns a SpanSet that contains a Span for each element in "this".Converts "this" to aFloatSpan
instance.toString()
Return the string representation of the content of "this".Returns the union of "this" and "other".upper()
Returns the upper bound of "this".float
width()
Returns the width of "this".Methods inherited from class types.collections.base.Span
add, as_hexwkb, as_wkb, contains, copy, eq, from_hexwkb, from_wkb, greaterThan, greaterThanOrEqual, hash, is_adjacent, is_contained_in, is_left, is_over_or_left, is_over_or_right, is_right, is_same, lessThan, lessThanOrEqual, lower_inc, minus, mul, notEquals, overlaps, to_spanset, union, upper_inc
-
Field Details
-
_inner
private final jnr.ffi.Pointer _inner
-
-
Constructor Details
-
IntSpan
public IntSpan(jnr.ffi.Pointer inner) ------------------------- Constructor ---------------------------------------- -
IntSpan
-
IntSpan
public IntSpan(int lower, int upper, boolean lower_inc, boolean upper_inc) -
IntSpan
-
IntSpan
-
IntSpan
-
IntSpan
public IntSpan(int lower, int upper)
-
-
Method Details
-
createStringInner
- Specified by:
createStringInner
in classSpan<Integer>
-
createInner
public jnr.ffi.Pointer createInner(jnr.ffi.Pointer inner) - Specified by:
createInner
in classSpan<Integer>
-
createIntInt
public jnr.ffi.Pointer createIntInt(Number lower, Number upper, boolean lower_inc, boolean upper_inc) - Specified by:
createIntInt
in classSpan<Integer>
-
createIntStr
public jnr.ffi.Pointer createIntStr(Number lower, String upper, boolean lower_inc, boolean upper_inc) - Specified by:
createIntStr
in classSpan<Integer>
-
createStrStr
public jnr.ffi.Pointer createStrStr(String lower, String upper, boolean lower_inc, boolean upper_inc) - Specified by:
createStrStr
in classSpan<Integer>
-
createStrInt
public jnr.ffi.Pointer createStrInt(String lower, Number upper, boolean lower_inc, boolean upper_inc) - Specified by:
createStrInt
in classSpan<Integer>
-
createIntIntNb
- Specified by:
createIntIntNb
in classSpan<Integer>
-
copy
Return a copy of "this".MEOS Functions:
- span_copy
- Returns:
- a new IntSpan instance
-
from_hexwkb
Returns a tstzspan from its WKB representation in hex-encoded ASCII.MEOS Functions:
- span_from_hexwkb
- Parameters:
str
- WKB representation in hex-encoded ASCII- Returns:
-
toString
Return the string representation of the content of "this".MEOS Functions:
- intspan_out
-
to_spanset
Returns a SpanSet that contains a Span for each element in "this".MEOS Functions:
- span_to_spanset
- Returns:
- A new
IntSpanSet
instance
-
tofloatspan
- Returns:
- A new :class:`FloatSpan` instance
-
get_inner
public jnr.ffi.Pointer get_inner()------------------------- Accessors ------------------------------------- -
lower
Returns the lower bound of "this".MEOS Functions:
- period_lower
-
upper
Returns the upper bound of "this".MEOS Functions:
- period_upper
-
width
public float width()Returns the width of "this".MEOS Functions:
- span_width
-
shift
Return a new "IntSpanSet" with the lower and upper bounds shifted by "delta".MEOS Functions:
- floatspanset_shift_scale
- Parameters:
delta
- The value to shift by- Returns:
- A new
IntSpanSet
instance
-
scale
Return a new "IntSpanSet" with the lower and upper bounds scaled so that the width is "width".MEOS Functions:
- floatspanset_shift_scale
- Parameters:
width
- The new width- Returns:
- a new
IntSpanSet
instance
-
shift_scale
Return a new "IntSpanSet" with the lower and upper bounds shifted by "delta" and scaled so that the width is "width".MEOS Functions:
- floatspanset_shift_scale
- Parameters:
delta
- The value to shift bywidth
- v- Returns:
- a new
IntSpanSet
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
- adjacent_intspan_int
- Parameters:
other
- object to compare with- Returns:
- True if adjacent, False otherwise
- Throws:
Exception
-
contains
Returns whether "this" contains "content".MEOS Functions:
- contains_set_set
- contains_intspan_int
- Parameters:
other
- object to compare with- Returns:
- True if contains, False otherwise
- Throws:
Exception
-
is_same
Returns whether "this" and the bounding period of "other is the same.MEOS Functions:
- same_period_temporal
- Parameters:
other
- object to compare with- Returns:
- True if equal, False otherwise
- 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 left_intspan_int
- Parameters:
other
- 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 value).MEOS Functions:
- overleft_span_span
- overleft_span_spanset
- overleft_intspan_int
- Parameters:
other
- 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
- right_intspan_int
- Parameters:
other
- 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 value).MEOS Functions:
- overright_span_span
- overright_span_spanset
- overright_intspan_int
- Parameters:
other
- 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_span_spanset
- distance_intspan_int
- Parameters:
other
- object to compare with- Returns:
- A float value
- Throws:
Exception
-
intersection
- Throws:
Exception
-
minus
Returns the difference of "this" and "other".MEOS Functions:
- minus_span_span
- minus_spanset_span
- minus_intspan_int
- Parameters:
other
- object to diff with- Returns:
- A
IntSpanSet
instance.
-
union
Returns the union of "this" and "other".MEOS Functions:
- union_spanset_span
- union_span_span
- union_intspan_int
- Parameters:
other
- object to merge with- Returns:
- A
IntSpanSet
instance. - Throws:
Exception
-