Class Set<T>

java.lang.Object
types.collections.base.Set<T>
All Implemented Interfaces:
Base, Collection, TemporalObject
Direct Known Subclasses:
dateset, FloatSet, GeoSet, IntSet, test, TextSet, tstzset

public abstract class Set<T> extends Object implements Collection, Base
Abstract class that represents a set of temporal object
Author:
ARIJIT SAMAL
  • Field Summary

    Fields
    Modifier and Type
    Field
    Description
    private jnr.ffi.Pointer
     
  • Constructor Summary

    Constructors
    Constructor
    Description
    Set()
    ------------------------- Constructors ----------------------------------
    Set(String str)
     
    Set(jnr.ffi.Pointer inner)
     
  • Method Summary

    Modifier and Type
    Method
    Description
    add(Base other)
    Returns the union of ``self`` and ``other``.
    Returns the WKB representation in hex-encoded ASCII.
    jnr.ffi.Pointer
    Returns the WKB representation
    boolean
    contains(Base other)
    Returns whether "this" contains "other".
    jnr.ffi.Pointer
    Returns the copy of a span
    abstract jnr.ffi.Pointer
    createInner(jnr.ffi.Pointer inner)
     
    abstract jnr.ffi.Pointer
     
    private void
    distance(Base other)
    Returns the distance between "this" and "other".
    element_n(int n)
    Returns the n-th element in "this".
    elements(List<T> list)
    Returns the elements.
    abstract T
    Returns the last element in "this".
    boolean
    eq(Base other)
    Returns whether "this" and "other" are equal.
    <T> T
    from_hexwkb(String hexwkb, Class<T> spansetType)
    Returns a `TsTzSpan` from its WKB representation in hex-encoded ASCII.
    <T> T
    from_wkb(jnr.ffi.Pointer wkb, long size, Class<T> spansetType)
    Returns a `TsTzSpan` from its WKB representation.
    abstract jnr.ffi.Pointer
     
    boolean
    Return whether "this" is greater than "other".
    boolean
    Return whether "this" is greater than or equal to "other".
    long
    Return the hash representation of "this".
    private Base
    Returns the intersection of ``self`` and ``other``.
    boolean
    Returns whether ``this`` is adjacent to ``other``.
    boolean
    Returns whether "this" is contained in "other".
    boolean
    is_left(Base other)
    Returns whether "this" is strictly to the left of "other".
    boolean
    Returns whether "this" is to the left of "other" allowing overlap.
    boolean
    Returns whether "this" is to the right of "other" allowing overlap.
    boolean
    is_right(Base other)
    Returns whether "this" is strictly to the right of "other".
    int
    Returns the number of elements in "this".
    boolean
    lessThan(Base other)
    Return whether "this" is less than "other".
    boolean
    Return whether "this" is less than or equal to "other".
    private Base
    minus(Base other)
    Returns the difference of ``self`` and ``other``.
    mul(Base other)
    Returns the intersection of ``self`` and ``other``.
    boolean
    notEquals(Base other)
    Returns whether "this" and "other" are not equal.
    int
    Returns the number of elements in "this".
    boolean
    overlaps(Base other)
    Returns whether "this" overlaps "other".
    rsub(Base other)
    Returns the difference of ``other`` and ``self``.
    abstract T
    Returns the first element in "this".
    sub(Base other)
    Returns the difference of ``self`` and ``other``.
    Returns the difference of ``other`` and ``self``.
    <T> T
    to_span(Class<T> spanType)
    Returns a span that encompasses "this".
    <T> T
    to_spanset(Class<T> spansetType)
    Returns a SpanSet that contains a Span for each element in "this".
    private Base
    union(Base other)
    Returns the union of ``self`` and ``other``.

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Field Details

    • _inner

      private jnr.ffi.Pointer _inner
  • Constructor Details

    • Set

      public Set()
      ------------------------- Constructors ----------------------------------
    • Set

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

      public Set(String str)
  • Method Details

    • get_inner

      public abstract jnr.ffi.Pointer get_inner()
    • createInner

      public abstract jnr.ffi.Pointer createInner(jnr.ffi.Pointer inner)
    • createStringInner

      public abstract jnr.ffi.Pointer createStringInner(String str)
    • copy

      public jnr.ffi.Pointer copy()
      Returns the copy of a span
      Returns:
      Pointer type
    • from_wkb

      public <T> T from_wkb(jnr.ffi.Pointer wkb, long size, Class<T> spansetType) throws NoSuchMethodException, InvocationTargetException, InstantiationException, IllegalAccessException
      Returns a `TsTzSpan` from its WKB representation.
      Returns:
      Pointer type
      Throws:
      NoSuchMethodException
      InvocationTargetException
      InstantiationException
      IllegalAccessException
    • from_hexwkb

      public <T> T from_hexwkb(String hexwkb, Class<T> spansetType) throws NoSuchMethodException, InvocationTargetException, InstantiationException, IllegalAccessException
      Returns a `TsTzSpan` from its WKB representation in hex-encoded ASCII.
      Returns:
      T type
      Throws:
      NoSuchMethodException
      InvocationTargetException
      InstantiationException
      IllegalAccessException
    • as_wkb

      public jnr.ffi.Pointer as_wkb()
      Returns the WKB representation
      Returns:
      Pointer type
    • as_hexwkb

      public String as_hexwkb()
      Returns the WKB representation in hex-encoded ASCII.
      Returns:
      String type
    • to_span

      Returns a span that encompasses "this".

      MEOS Functions:

    • set_to_span
    • Returns:
      A new Span instance
      Throws:
      NoSuchMethodException
      InvocationTargetException
      InstantiationException
      IllegalAccessException
    • to_spanset

      Returns a SpanSet that contains a Span for each element in "this".

      MEOS Functions:

    • set_to_spanset
    • Returns:
      A new SpanSet instance
      Throws:
      NoSuchMethodException
      InvocationTargetException
      InstantiationException
      IllegalAccessException
    • num_elements

      public int num_elements()
      Returns the number of elements in "this".

      MEOS Functions:

    • set_num_values
    • Returns:
      An Integer
    • length

      public int length()
      Returns the number of elements in "this".

      MEOS Functions:

    • set_num_values
    • Returns:
      An Integer
    • start_element

      public abstract T start_element() throws org.locationtech.jts.io.ParseException
      Returns the first element in "this".
      Returns:
      A Set instance
      Throws:
      org.locationtech.jts.io.ParseException
    • end_element

      public abstract T end_element() throws org.locationtech.jts.io.ParseException
      Returns the last element in "this".
      Returns:
      A Set instance
      Throws:
      org.locationtech.jts.io.ParseException
    • element_n

      public T element_n(int n) throws Exception
      Returns the n-th element in "this".
      Parameters:
      n - the n-th element
      Returns:
      A Set instance
      Throws:
      Exception
    • elements

      public T elements(List<T> list) throws Exception
      Returns the elements.
      Returns:
      A Set instance
      Throws:
      Exception
    • hash

      public long hash()
      Return the hash representation of "this".

      MEOS Functions:

    • set_hash
    • Returns:
      A new Integer instance
    • is_contained_in

      public boolean is_contained_in(Base other) throws Exception
      Returns whether "this" is contained in "other".

      MEOS Functions:

      • contained_span_span
      • contained_span_spanset
      • contained_set_set
      • contained_spanset_spanset
      Specified by:
      is_contained_in in interface Collection<T>
      Parameters:
      other - object to compare with
      Returns:
      True if contained, False otherwise
      Throws:
      Exception
    • contains

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

      MEOS Functions:

    • contains_set_set
    • Specified by:
      contains in interface Collection<T>
      Parameters:
      other - object to compare with
      Returns:
      True if contains, False otherwise
      Throws:
      Exception
    • overlaps

      public boolean overlaps(Base other) throws Exception
      Returns whether "this" overlaps "other". That is, both share at least an instant

      MEOS Functions:

      • overlaps_set_set
      • overlaps_span_span
      • overlaps_spanset_spanset
      Specified by:
      overlaps in interface Collection<T>
      Parameters:
      other - object to compare with
      Returns:
      True if overlaps, False otherwise
      Throws:
      Exception
    • is_left

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

      MEOS Functions:

      • left_span_span
      • left_span_spanset
      Specified by:
      is_left in interface Collection<T>
      Parameters:
      other - object to compare with
      Returns:
      True if before, False otherwise
      Throws:
      Exception
    • is_over_or_left

      public boolean is_over_or_left(Base 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_span_span
    • overleft_span_spanset
    • Specified by:
      is_over_or_left in interface Collection<T>
      Parameters:
      other - object to compare with
      Returns:
      True if before, False otherwise
      Throws:
      Exception
    • is_over_or_right

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

      MEOS Functions:

      • overright_span_span
      • overright_span_spanset
      Specified by:
      is_over_or_right in interface Collection<T>
      Parameters:
      other - object to compare with
      Returns:
      True if overlapping or to the right, False otherwise
      Throws:
      Exception
    • is_right

      public boolean is_right(Base other) throws Exception
      Returns whether "this" is strictly to the right of "other". That is, the first element in "this" is to the right "other".

      MEOS Functions:

      • right_set_set
      • right_span_span
      • right_span_spanset
      Specified by:
      is_right in interface Collection<T>
      Parameters:
      other - object to compare with
      Returns:
      True if right, False otherwise
      Throws:
      Exception
    • distance

      private void distance(Base other) throws Exception
      Returns the distance between "this" and "other".

      MEOS Functions:

      • distance_set_set
      • distance_span_span
      • distance_spanset_span
      Parameters:
      other - object to compare with
      Throws:
      Exception
    • is_adjacent

      public boolean is_adjacent(Base other) throws Exception
      Returns whether ``this`` is adjacent to ``other``. That is, they share a bound but only one of them contains it. Args: other: object to compare with Returns: True if adjacent, False otherwise MEOS Functions: adjacent_span_span, adjacent_span_spanset
      Throws:
      Exception
    • intersection

      private Base intersection(Base other) throws Exception
      Returns the intersection of ``self`` and ``other``. Args: other: object to intersect with Returns: A :class:`Collection` instance. The actual class depends on ``other``. MEOS Functions: intersection_set_set, intersection_spanset_span, intersection_spanset_spanset
      Throws:
      Exception
    • mul

      public Base mul(Base other) throws Exception
      Returns the intersection of ``self`` and ``other``. Args: other: object to intersect with Returns: A :class:`Collection` instance. The actual class depends on ``other``.
      Throws:
      Exception
    • minus

      private Base minus(Base other) throws Exception
      Returns the difference of ``self`` and ``other``. Args: other: object to diff with Returns: A :class:`Collection` instance. The actual class depends on ``other``.
      Throws:
      Exception
    • sub

      public Base sub(Base other) throws Exception
      Returns the difference of ``self`` and ``other``. Args: other: object to diff with Returns: A :class:`Collection` instance. The actual class depends on ``other``.
      Throws:
      Exception
    • subtract_from

      public Base subtract_from(Base other) throws Exception
      Returns the difference of ``other`` and ``self``. Args: other: object to subtract ``self`` from Returns: A :class:`Collection` instance or an element instance. The actual class depends on ``other``. See Also: :meth:`minus`
      Throws:
      Exception
    • rsub

      public Base rsub(Base other) throws Exception
      Returns the difference of ``other`` and ``self``. Args: other: object to subtract ``self`` from Returns: A :class:`Collection` instance or an element instance. The actual class depends on ``other``.
      Throws:
      Exception
    • union

      private Base union(Base other) throws Exception
      Returns the union of ``self`` and ``other``. Args: other: object to merge with Returns: A :class:`Collection` instance. The actual class depends on ``other``.
      Throws:
      Exception
    • add

      public Base add(Base other) throws Exception
      Returns the union of ``self`` and ``other``. Args: other: object to merge with Returns: A :class:`Collection` instance. The actual class depends on ``other``.
      Throws:
      Exception
    • eq

      public boolean eq(Base other)
      Returns whether "this" and "other" are equal.

      MEOS Functions:

    • set_eq
    • Parameters:
      other - object to compare with
      Returns:
      True if equal, False otherwise
    • notEquals

      public boolean notEquals(Base other)
      Returns whether "this" and "other" are not equal.

      MEOS Functions:

    • set_ne
    • Parameters:
      other - object to compare with
      Returns:
      True if not equal, False otherwise
    • lessThan

      public boolean lessThan(Base other) throws Exception
      Return whether "this" is less than "other".

      MEOS Functions:

    • set_lt
    • Parameters:
      other - object to compare with
      Returns:
      True if less than, False otherwise
      Throws:
      Exception
    • lessThanOrEqual

      public boolean lessThanOrEqual(Base other) throws Exception
      Return whether "this" is less than or equal to "other".

      MEOS Functions:

    • set_le
    • Parameters:
      other - object to compare with
      Returns:
      True if less than or equal, False otherwise
      Throws:
      Exception
    • greaterThan

      public boolean greaterThan(Base other) throws Exception
      Return whether "this" is greater than "other".

      MEOS Functions:

    • set_gt
    • Parameters:
      other - object to compare with
      Returns:
      True if greater than, False otherwise
      Throws:
      Exception
    • greaterThanOrEqual

      public boolean greaterThanOrEqual(Base other) throws Exception
      Return whether "this" is greater than or equal to "other".

      MEOS Functions:

    • set_ge
    • Parameters:
      other - object to compare with
      Returns:
      True if greater than or equal, False otherwise
      Throws:
      Exception