Class FloatSpanSet
- All Implemented Interfaces:
Base
,Collection
,Number
,TemporalObject
``FloatSpanSet`` objects can be created with a single argument of type string as in MobilityDB.
>>> FloatSpanSet(string='{[8, 10], [11, 1]}')
Another possibility is to give a list specifying the composing spans, which can be instances of ``str`` or ``FloatSpan``. The composing spans must be given in increasing order.
>>> FloatSpanSet(span_list=['[8, 10]', '[11, 12]']) >>> FloatSpanSet(span_list=[FloatSpan('[8, 10]'), FloatSpan('[11, 12]')])
- Author:
- ARIJIT SAMAL
-
Field Summary
-
Constructor Summary
ConstructorDescriptionFloatSpanSet
(String str) FloatSpanSet
(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) Returns the intersection of "this" and "other".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 "FloatSpanSet" with the lower and upper bounds scaled so that the width is "width".shift
(int delta) Return a new "FloatSpanSet" with the lower and upper bounds shifted by "delta".shift_scale
(int delta, int width) Return a new "FloatSpanSet" 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
(int max_decimals) Return the string representation of the content of "this".Returns the union of "this" and "other".float
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
-
FloatSpanSet
public FloatSpanSet(jnr.ffi.Pointer inner) ------------------------- Constructors ---------------------------------- -
FloatSpanSet
-
-
Method Details
-
createStringInner
- Specified by:
createStringInner
in classSpanSet<Float>
-
createInner
public jnr.ffi.Pointer createInner(jnr.ffi.Pointer inner) - Specified by:
createInner
in classSpanSet<Float>
-
toString
Return the string representation of the content of "this".MEOS Functions:
- floatspanset_out
- Parameters:
max_decimals
- number of maximum decimals- Returns:
- A new
String
instance
-
to_span
Returns a span that encompasses "this".MEOS Functions:
- spanset_span
- Returns:
- A new
FloatSpan
instance
-
to_intspanset
Returns an intspanset that encompasses "this".MEOS Functions:
- floatspanset_intspanset
- Returns:
- A new
IntSpanSet
instance
-
get_inner
public jnr.ffi.Pointer get_inner()------------------------- Accessors ------------------------------------- -
width
public float 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 "FloatSpanSet" with the lower and upper bounds shifted by "delta".MEOS Functions:
- floatspanset_shift_scale
- Parameters:
delta
- The value to shift by- Returns:
- A new
FloatSpanSet
instance
-
scale
Return a new "FloatSpanSet" 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
FloatSpanSet
instance
-
shift_scale
Return a new "FloatSpanSet" 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
FloatSpanSet
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_floatspanset_float
- 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_floatspanset_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_floatspan_float
- 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_floatspan_float
- 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_floatspan_float
- 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_floatspanset_float
- 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_floatspanset_float
- Parameters:
other
- object to compare with- Returns:
- A float value
- Throws:
Exception
-
intersection
Returns the intersection of "this" and "other".MEOS Functions:
- intersection_floatspanset_float
- Parameters:
other
- object to intersect with- Returns:
- An boolean value
- Throws:
Exception
-
mul
- Throws:
Exception
-
minus
Returns the difference of "this" and "other".MEOS Functions:
- minus_spanset_span
- minus_spanset_spanset
- minus_floatspanset_float
- Parameters:
other
- object to diff with- Returns:
- A
FloatSpanSet
instance. - Throws:
Exception
-
sub
- Throws:
Exception
-
union
Returns the union of "this" and "other".MEOS Functions:
- union_floatspanset_float
- union_spanset_spanset
- union_spanset_span
- Parameters:
other
- object to merge with- Returns:
- A
FloatSpanSet
instance. - Throws:
Exception
-
add
- Throws:
Exception
-