Interface TimeSet<K>

  • Type Parameters:
    K - key type
    All Known Implementing Classes:
    IntervalSet, TimestampSet

    public interface TimeSet<K>
    Interface that defines the functionalities both timestamp and interval set have.
    • Method Detail

      • add

        boolean add​(K key)
        Adds key to this set.
        Parameters:
        key - key
        Returns:
        true if added, false otherwise
      • remove

        boolean remove​(K key)
        Removes key from this set.
        Parameters:
        key - key
        Returns:
        true if removed, false otherwise
      • size

        int size()
        Returns the size of this set.
        Returns:
        the number of elements in this set
      • isEmpty

        boolean isEmpty()
        Returns true if this set is empty.
        Returns:
        true if empty, false otherwise
      • contains

        boolean contains​(K key)
        Returns true if this set contains key.
        Parameters:
        key - key
        Returns:
        true if contains, false otherwise
      • toArray

        K[] toArray()
        Returns an array of all keys in this set.

        This method may return a reference to the underlying array so clients should make a copy if the array is written to.

        Returns:
        array of all keys
      • toPrimitiveArray

        Object toPrimitiveArray()
        Returns the same result as toArray() but in a primitive array if the underlying storage is in a primtive form.
        Returns:
        array of all keys
      • clear

        void clear()
        Empties this set.
      • toString

        String toString​(TimeFormat timeFormat)
        Returns this set as a string.
        Parameters:
        timeFormat - time format
        Returns:
        set as string
      • toString

        String toString​(TimeFormat timeFormat,
                        DateTimeZone timeZone)
        Returns this set as a string.
        Parameters:
        timeFormat - time format
        timeZone - time zone
        Returns:
        set as string