Class FloatSpan
- All Implemented Interfaces:
Base
,Collection
,Number
,TemporalObject
``FloatSpan`` objects can be created with a single argument of type string as in MobilityDB.
>>> FloatSpan('(2.5, 5.21]')
Another possibility is to provide the ``lower`` and ``upper`` named parameters (of type str or float), and optionally indicate whether the bounds are inclusive or exclusive (by default, the lower bound is inclusive and the upper is exclusive):
>>> FloatSpan(lower=2.0, upper=5.8) >>> FloatSpan(lower=2.0, upper=5.8, lower_inc=False, upper_inc=True) >>> FloatSpan(lower='2.0', upper='5.8', upper_inc=True)
- Author:
- ARIJIT SAMAL
-
Field Summary
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionboolean
Returns whether "this" contains "content".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".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 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 "FloatSpan" with the lower and upper bounds scaled so that the width is "width".shift
(int delta) Return a new "FloatSpan" with the lower and upper bounds shifted by "delta".shift_scale
(int delta, int width) Return a new "FloatSpan" with the lower and upper bounds shifted by "delta" and scaled so that the width is "width".Converts "this" to aIntSpan
instance.Returns a SpanSet that contains a Span for each element in "this".toString
(int max_decimals) 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
-
FloatSpan
public FloatSpan(jnr.ffi.Pointer inner) ------------------------- Constructors ---------------------------------- -
FloatSpan
-
FloatSpan
public FloatSpan(float lower, float upper, boolean lower_inc, boolean upper_inc) -
FloatSpan
-
FloatSpan
-
FloatSpan
-
FloatSpan
public FloatSpan(float lower, float upper)
-
-
Method Details
-
createStringInner
- Specified by:
createStringInner
in classSpan<Float>
-
createInner
public jnr.ffi.Pointer createInner(jnr.ffi.Pointer inner) - Specified by:
createInner
in classSpan<Float>
-
createIntInt
public jnr.ffi.Pointer createIntInt(Number lower, Number upper, boolean lower_inc, boolean upper_inc) - Specified by:
createIntInt
in classSpan<Float>
-
createIntStr
public jnr.ffi.Pointer createIntStr(Number lower, String upper, boolean lower_inc, boolean upper_inc) - Specified by:
createIntStr
in classSpan<Float>
-
createStrStr
public jnr.ffi.Pointer createStrStr(String lower, String upper, boolean lower_inc, boolean upper_inc) - Specified by:
createStrStr
in classSpan<Float>
-
createStrInt
public jnr.ffi.Pointer createStrInt(String lower, Number upper, boolean lower_inc, boolean upper_inc) - Specified by:
createStrInt
in classSpan<Float>
-
createIntIntNb
- Specified by:
createIntIntNb
in classSpan<Float>
-
toString
Return the string representation of the content of "this".MEOS Functions:
- floatspan_out
- Parameters:
max_decimals
- number of maximum decimals- Returns:
- A new
String
instance
-
to_spanset
Returns a SpanSet that contains a Span for each element in "this".MEOS Functions:
- set_to_spanset
- Returns:
- A new
FloatSpanSet
instance
-
to_intspan
- Returns:
- A new
IntSpan
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 "FloatSpan" with the lower and upper bounds shifted by "delta".MEOS Functions:
- floatspan_shift_scale
- Parameters:
delta
- The value to shift by- Returns:
- A new
FloatSpan
instance
-
scale
Return a new "FloatSpan" with the lower and upper bounds scaled so that the width is "width".MEOS Functions:
- floatspan_shift_scale
- Parameters:
width
- The new width- Returns:
- a new
FloatSpan
instance
-
shift_scale
Return a new "FloatSpan" with the lower and upper bounds shifted by "delta" and scaled so that the width is "width".MEOS Functions:
- floatspan_shift_scale
- Parameters:
delta
- The value to shift bywidth
- value to compare with- Returns:
- a new
FloatSpan
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_floatspan_float
- 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_floatspan_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 before "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 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_floatspan_float
- 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_floatspan_float
- 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_floatspan_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_span_span
- distance_span_spanset
- distance_floatspan_float
- Parameters:
other
- object to compare with- Returns:
- A float value
- Throws:
Exception
-
intersection
Returns the intersection of "this" and "other".MEOS Functions:
- intersection_span_span
- intersection_spanset_span
- intersection_floatset_float
-
minus
Returns the difference of "this" and "other".MEOS Functions:
- minus_span_span
- minus_spanset_span
- minus_floatspan_float
- Parameters:
other
- object to diff with- Returns:
- A
FloatSpanSet
instance.
-
union
Returns the union of "this" and "other".MEOS Functions:
- union_spanset_span
- union_span_span
- union_floatspan_float
- Parameters:
other
- object to merge with- Returns:
- A
FloatSpanSet
instance. - Throws:
Exception
-