Class IntSet

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

public class IntSet extends Set<Integer> 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.

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

Another possibility is to create a ``TextSet`` object from a list of strings or integers.

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

Author:
ARIJIT SAMAL
  • Field Details

    • _inner

      private final jnr.ffi.Pointer _inner
  • Constructor Details

    • IntSet

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

      public IntSet(String str)
  • Method Details

    • createStringInner

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

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

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

      MEOS Functions:

    • intset_out
    • Overrides:
      toString in class Object
      Returns:
      A new String instance
    • to_spanset

      public IntSpanSet to_spanset()
      Returns a SpanSet that contains a Span for each element in "this".

      MEOS Functions:

    • set_to_spanset
    • Returns:
      A new IntSpanSet instance
    • to_span

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

      MEOS Functions:

    • set_span
    • Returns:
      A IntSpan instance
    • to_floatset

      public FloatSet to_floatset()
    • get_inner

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

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

      MEOS Functions:

    • intset_start_value
    • Specified by:
      start_element in class Set<Integer>
      Returns:
      A Integer instance
    • end_element

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

      MEOS Functions:

    • intset_end_value
    • Specified by:
      end_element in class Set<Integer>
      Returns:
      A Integer instance
    • element_n

      public Integer element_n(int n) throws Exception
      Description copied from class: Set
      Returns the n-th element in "this".
      Overrides:
      element_n in class Set<Integer>
      Parameters:
      n - the n-th element
      Returns:
      A Set instance
      Throws:
      Exception
    • elements

      public List<Integer> elements()
    • shift

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

      MEOS Functions:

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

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

      MEOS Functions:

    • intset_shift_scale
    • Parameters:
      width - The new width.
      Returns:
      A new IntSet instance
    • shift_scale

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

      MEOS Functions:

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

      public boolean contains(Object other) throws Exception
      ------------------------- Topological Operations --------------------------------
      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_intset_int
    • 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_intset_int
    • 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_intset_int
    • 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_intset_int
    • Parameters:
      other - object to compare with
      Returns:
      True if is over or right, False otherwise
      Throws:
      Exception
    • intersection

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

      MEOS Functions:

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

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

      MEOS Functions:

    • minus_set_set
    • minus_intset_int
    • Parameters:
      other - A IntSet or Integer instance
      Returns:
      A IntSet instance or "None" if the difference is empty.
      Throws:
      Exception
    • subtract_from

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

      MEOS Functions:

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

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

      MEOS Functions:

    • union_set_set
    • union_intset_int
    • Parameters:
      other - A IntSet or Integer instance
      Returns:
      A IntSet instance.
      Throws:
      Exception
    • distance

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

      MEOS functions:

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