Class IntSpanSet
- All Implemented Interfaces:
Base
,Collection
,Number
,TemporalObject
``IntSpanSet`` objects can be created with a single argument of type string as in MobilityDB.
>>> IntSpanSet(string='{[8, 10], [11, 12]}')
Another possibility is to give a list specifying the composing spans, which can be instances of ``str`` or ``IntSpan``. The composing spans must be given in increasing order.
>>> IntSpanSet(span_list=['[8, 10]', '[11, 12]']) >>> IntSpanSet(span_list=[IntSpan('[8, 10]'), IntSpan('[11, 12]')])
- Author:
- ARIJIT SAMAL
-
Field Summary
-
Constructor Summary
ConstructorDescriptionIntSpanSet
(String str) IntSpanSet
(jnr.ffi.Pointer inner) ------------------------- Constructors ---------------------------------- -
Method Summary
Modifier and TypeMethodDescriptionadd
(int other) boolean
Returns whether "this" contains "content".jnr.ffi.Pointer
createInner
(jnr.ffi.Pointer inner) jnr.ffi.Pointer
createStringInner
(String str) float
Returns the distance between "this" and "other".end_span()
jnr.ffi.Pointer
------------------------- Accessors -------------------------------------intersection
(Object other) ------------------------- Set Operations --------------------------------boolean
is_adjacent
(Object other) Returns whether "this" is adjacent to "other".boolean
Returns whether "this" is strictly left of "other".boolean
is_over_or_left
(Object other) Returns whether "this" is left "other" allowing overlap.boolean
is_over_or_right
(Object other) Returns whether "this" is right "other" allowing overlap.boolean
Returns whether "this" is strictly right "other".boolean
Returns whether "this" and the bounding period of "other" is the same.Returns the difference of "this" and "other".mul
(int 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".span_n
(int n) spans()
sub
(int other) Returns an intspanset that encompasses "this".to_span()
Returns a span that encompasses "this".toString()
Return the string representation of the content of "this".Returns the union of "this" and "other".int
width
(boolean ignore_gaps) Returns the width of the spanset.Methods inherited from class types.collections.base.SpanSet
add, as_hexwkb, as_wkb, contains, copy, end_span, eq, from_hexwkb, from_wkb, greaterThan, greaterThanOrEqual, hash, intersection, is_adjacent, is_contained_in, is_left, is_over_or_left, is_over_or_right, is_right, is_same, lessThan, lessThanOrEqual, minus, mul, notEquals, num_spans, overlaps, span_n, spans, start_span, sub, to_span, union
-
Field Details
-
_inner
private final jnr.ffi.Pointer _inner
-
-
Constructor Details
-
IntSpanSet
public IntSpanSet(jnr.ffi.Pointer inner) ------------------------- Constructors ---------------------------------- -
IntSpanSet
-
-
Method Details
-
createStringInner
- Specified by:
createStringInner
in classSpanSet<Integer>
-
createInner
public jnr.ffi.Pointer createInner(jnr.ffi.Pointer inner) - Specified by:
createInner
in classSpanSet<Integer>
-
toString
Return the string representation of the content of "this".MEOS Functions:
- intspanset_out
-
to_span
Returns a span that encompasses "this".MEOS Functions:
- spanset_span
- Returns:
- A new
IntSpan
instance
-
to_floatspanset
Returns an intspanset that encompasses "this".MEOS Functions:
- intspanset_floatspanset
- Returns:
- A new
FloatSpanSet
instance
-
get_inner
public jnr.ffi.Pointer get_inner()------------------------- Accessors ------------------------------------- -
width
public int width(boolean ignore_gaps) Returns the width of the spanset. By default, i.e., when the second argument is False, the function takes into account the gaps within, i.e., returns the sum of the widths of the spans within. Otherwise, the function returns the width of the spanset ignoring any gap, i.e., the width from the lower bound of the first span to the upper bound of the last span.MEOS Functions:
- spanset_width
- Parameters:
ignore_gaps
- Whether to take into account potential gaps in * the spanset.- Returns:
- A `float` representing the duration of the spanset
-
start_span
-
end_span
-
span_n
-
spans
-
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_spanset_span
- adjacent_spanset_spanset
- adjacent_intspanset_int
- Parameters:
other
- object to compare with- Returns:
- True if adjacent, False otherwise
- Throws:
Exception
-
contains
Returns whether "this" contains "content".MEOS Functions:
- contains_spanset_span
- contains_spanset_spanset
- contains_intspanset_float
- 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 left of "other". That is, "this" ends before "other" starts.MEOS Functions:
- left_span_span
- left_span_spanset
- left_intspanset_int
- Parameters:
other
- object to compare with- Returns:
- True if left, False otherwise
- Throws:
Exception
-
is_over_or_left
Returns whether "this" is left "other" allowing overlap. That is, "this" ends before "other" ends (or at the same value).MEOS Functions:
- overleft_span_span
- overleft_span_spanset
- overleft_intspanset_int
- Parameters:
other
- object to compare with- Returns:
- True if before, False otherwise
- Throws:
Exception
-
is_right
Returns whether "this" is strictly right "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 right, False otherwise
- Throws:
Exception
-
is_over_or_right
Returns whether "this" is right "other" allowing overlap. That is, "this" starts after "other" starts (or at the same value).MEOS Functions:
- overright_spanset_span
- overright_spanset_spanset
- overright_intspanset_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_spanset_span
- distance_spanset_spanset
- distance_intspanset_int
- Parameters:
other
- object to compare with- Returns:
- A float value
- Throws:
Exception
-
intersection
------------------------- Set Operations --------------------------------- Throws:
Exception
-
mul
- Throws:
Exception
-
minus
Returns the difference of "this" and "other".MEOS Functions:
- minus_spanset_span
- minus_spanset_spanset
- minus_intspanset_int
- Parameters:
other
- object to diff with- Returns:
- A
IntSpanSet
instance. - Throws:
Exception
-
sub
- Throws:
Exception
-
union
Returns the union of "this" and "other".MEOS Functions:
- union_intspanset_int
- union_spanset_spanset
- union_spanset_span
- Parameters:
other
- object to merge with- Returns:
- A
IntSpanSet
instance. - Throws:
Exception
-
add
- Throws:
Exception
-