Class TextSet

java.lang.Object
types.collections.base.Set<String>
types.collections.text.TextSet
All Implemented Interfaces:
Base, Collection, TemporalObject

public class TextSet extends Set<String>
Class for representing a set of text values.

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

>>> TextSet(string='{a, b, c, def}')

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

>>> TextSet(elements=['a', 'b', 'c', 'def'])

Author:
ARIJIT SAMAL
  • Field Details

    • _inner

      private jnr.ffi.Pointer _inner
  • Constructor Details

    • TextSet

      public TextSet()
      ------------------------- Constructors ----------------------------------
    • TextSet

      public TextSet(String str)
    • TextSet

      public TextSet(jnr.ffi.Pointer inner)
  • Method Details

    • createStringInner

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

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

      public String as_hexwkb()
      Description copied from class: Set
      Returns the WKB representation in hex-encoded ASCII.
      Overrides:
      as_hexwkb in class Set<String>
      Returns:
      String type
    • toString

      public String toString()
      Return the string representation of the content of ``self``.

      MEOS Functions:

    • textset_out
    • Overrides:
      toString in class Object
      Returns:
      A new String instance
    • get_inner

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

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

      MEOS Functions:

    • textset_start_value
    • Specified by:
      start_element in class Set<String>
      Returns:
      A String instance
    • end_element

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

      MEOS Functions:

    • textset_end_value
    • Specified by:
      end_element in class Set<String>
      Returns:
      A String instance
    • element_n

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

      MEOS Functions:

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

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

      MEOS Functions:

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

      public TextSet lowercase()
      Returns a new textset that is the result of appling uppercase to "this"

      MEOS Functions:

    • textset_lower
    • Returns:
      A new TextSet instance
    • uppercase

      public TextSet uppercase()
      Returns a new textset that is the result of appling uppercase to "this"

      MEOS Functions:

    • textset_upper
    • Returns:
      A new TextSet instance
    • intersection

      public TextSet intersection(TextSet ts)
      Returns the intersection of "this" and "other".

      MEOS Functions:

    • intersection_textset_text
    • intersection_set_set
    • Parameters:
      ts - A TextSet or String instance
      Returns:
      An object of the same type as "other" or null if the intersection is empty.
    • minus

      public TextSet minus(Object other)
      Returns the difference of "this" and "other".

      MEOS Functions:

    • minus_textset_text
    • minus_set_set
    • Parameters:
      other - A TextSet or String instance
      Returns:
      A TextSet instance or "null" if the difference is empty.
    • union

      public TextSet union(Object other)
      Returns the union of "this" and "other".

      MEOS Functions:

    • union_textset_text
    • union_set_set
    • Parameters:
      other - A :class:`TextSet` or :class:`str` instance
      Returns:
      A :class:`TextSet` instance.