Class FloatSet

java.lang.Object
types.collections.base.Set<Float>
types.collections.number.FloatSet
All Implemented Interfaces:
Base, Collection, Number, TemporalObject

public class FloatSet extends Set<Float> implements Number
Class for representing a set of text values.

"TextSet" objects can be created with a single argument of type string as in MobilityDB.

>>> FloatSet(string='{1, 3, 56}')

Another possibility is to create a "TextSet" object from a list of strings or floats.

>>> FloatSet(elements=[1, '2', 3, '56'])

Author:
ARIJIT SAMAL
  • Field Details

    • _inner

      private final jnr.ffi.Pointer _inner
  • Constructor Details

    • FloatSet

      public FloatSet(jnr.ffi.Pointer inner)
    • FloatSet

      public FloatSet(String str)
  • Method Details

    • createStringInner

      public jnr.ffi.Pointer createStringInner(String str)
      Specified by:
      createStringInner in class Set<Float>
    • createInner

      public jnr.ffi.Pointer createInner(jnr.ffi.Pointer inner)
      Specified by:
      createInner in class Set<Float>
    • toString

      public String toString(int max_decimals)
      Return the string representation of the content of "this".

      MEOS Functions:

    • floatset_out
    • Parameters:
      max_decimals - number of maximum decimals
      Returns:
      A new String instance
    • to_spanset

      public FloatSpanSet 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_span

      public FloatSpan to_span()
      Returns a span that encompasses "this".

      MEOS Functions:

    • set_span
    • Returns:
      A new FloatSpan instance
    • to_intset

      public IntSet to_intset()
    • get_inner

      public jnr.ffi.Pointer get_inner()
      ------------------------- Accessors -------------------------------------
      Specified by:
      get_inner in class Set<Float>
    • start_element

      public Float start_element()
      Returns the first element in "this".

      MEOS Functions:

    • floatset_start_value
    • Specified by:
      start_element in class Set<Float>
      Returns:
      A Float instance
    • end_element

      public Float end_element()
      Returns the last element in "this".

      MEOS Functions:

    • floatset_end_value
    • Specified by:
      end_element in class Set<Float>
      Returns:
      A Float instance
    • element_n

      public Float element_n(int n) throws Exception
      Returns the "n"-th element in "this".

      MEOS Functions:

    • floatset_value_n
    • Overrides:
      element_n in class Set<Float>
      Parameters:
      n - The 0-based index of the element to return.
      Returns:
      A Float instance
      Throws:
      Exception
    • elements

      public List<Float> elements()
    • shift

      public FloatSet shift(float delta)
      Returns a new "FloatSet" instance with all elements shifted by "delta".

      MEOS Functions:

    • floatset_shift_scale
    • Parameters:
      delta - The value to shift by.
      Returns:
      A new FloatSet instance
    • scale

      public FloatSet scale(float new_width)
      Returns a new "FloatSet" instance with all elements scaled to so that the encompassing span has width "new_width".

      MEOS Functions:

    • floatset_shift_scale
    • Parameters:
      new_width - The new width.
      Returns:
      A new FloatSet instance
    • shift_scale

      public FloatSet shift_scale(float delta, float new_width)
      Returns a new "FloatSet" instance with all elements shifted by "delta" and scaled to so that the encompassing span has width "new_width".

      MEOS Functions: floatset_shift_scale

      Parameters:
      delta - The value to shift by.
      new_width - The new width.
      Returns:
      A new FloatSet instance
    • contains

      public boolean contains(Object other) throws Exception
      Returns whether "this" contains "content".

      MEOS Functions:

    • contains_set_set
    • contains_floatset_float
    • Parameters:
      other - object to compare with
      Returns:
      True if contains, False otherwise
      Throws:
      Exception
    • is_left

      public boolean is_left(Object other) throws Exception
      Returns whether "this" is strictly to the left of "other". That is, "this" ends before "other" starts.

      MEOS Functions:

    • left_set_set
    • left_floatset_float
    • Parameters:
      other - object to compare with
      Returns:
      True if left, False otherwise
      Throws:
      Exception
    • is_over_or_left

      public boolean is_over_or_left(Object other) throws Exception
      Returns whether "this" is to the left of "other" allowing overlap. That is, "this" ends before "other" ends (or at the same value).

      MEOS Functions:

    • overleft_set_set
    • overleft_floatset_float
    • Parameters:
      other - object to compare with
      Returns:
      True if is over or left, False otherwise
      Throws:
      Exception
    • is_right

      public boolean is_right(Object other) throws Exception
      Returns whether "this" is strictly to the right of "other". That is, "this" ends after "other" starts.

      MEOS Functions:

    • right_set_set
    • right_floatset_float
    • Parameters:
      other - object to compare with
      Returns:
      True if right, False otherwise
      Throws:
      Exception
    • is_over_or_right

      public boolean is_over_or_right(Object other) throws Exception
      Returns whether "this" is to the right of "other" allowing overlap. That is, "this" starts before "other" ends (or at the same value).

      MEOS Functions:

    • overright_set_set
    • overright_floatset_float
    • Parameters:
      other - object to compare with
      Returns:
      True if is over or right, False otherwise
      Throws:
      Exception
    • intersection

      public FloatSet intersection(Object other) throws Exception
      Returns the intersection of "this" and "other".

      MEOS Functions:

    • intersection_set_set
    • intersection_floatset_float
    • Parameters:
      other - A FloatSet or Float instance
      Returns:
      An object of the same type as "other" or "None" if the * intersection is empty.
      Throws:
      Exception
    • minus

      public FloatSet minus(Object other) throws Exception
      Returns the difference of "this" and "other".

      MEOS Functions:

    • minus_set_set
    • minus_floatset_float
    • Parameters:
      other - A FloatSet or Floatinstance
      Returns:
      A FloatSet instance or "None" if the difference is empty.
      Throws:
      Exception
    • subtract_from

      public jnr.ffi.Pointer subtract_from(float other)
      Returns the difference of "other" and "this".

      MEOS Functions:

    • minus_float_floatset
    • Parameters:
      other - A Float instance
      Returns:
      A Float instance or "None" if the difference is empty.
    • union

      public FloatSet union(Object other) throws Exception
      Returns the union of "this" and "other".

      MEOS Functions:

    • union_set_set
    • union_floatset_float
    • Parameters:
      other - A FloatSet or Float instance
      Returns:
      A FloatSet instance.
      Throws:
      Exception
    • distance

      public float distance(Object other) throws Exception
      /** Returns the distance between "this" and "other".

      MEOS functions:

    • distance_floatset_float
    • Parameters:
      other - object to compare with
      Returns:
      A float value
      Throws:
      Exception