Class ImmutableNavigableSet<E>

Type Parameters:
E -
All Implemented Interfaces:
Immutable, Iterable<E>, Collection<E>, NavigableSet<E>, SequencedCollection<E>, SequencedSet<E>, Set<E>, SortedSet<E>

public final class ImmutableNavigableSet<E> extends ImmutableSortedSet<E> implements NavigableSet<E>
  • Method Details

    • empty

      public static <E> ImmutableNavigableSet<E> empty()
      Type Parameters:
      E -
      Returns:
    • just

      public static <E extends Comparable<? super E>> ImmutableNavigableSet<E> just(E e)
      Type Parameters:
      E -
      Parameters:
      e -
      Returns:
    • of

      public static <E extends Comparable<? super E>> ImmutableNavigableSet<E> of(E e1)
      Type Parameters:
      E -
      Parameters:
      e1 -
      Returns:
    • of

      public static <E extends Comparable<? super E>> ImmutableNavigableSet<E> of(E e1, E e2)
      Type Parameters:
      E -
      Parameters:
      e1 -
      e2 -
      Returns:
    • of

      public static <E extends Comparable<? super E>> ImmutableNavigableSet<E> of(E e1, E e2, E e3)
      Type Parameters:
      E -
      Parameters:
      e1 -
      e2 -
      e3 -
      Returns:
    • of

      public static <E extends Comparable<? super E>> ImmutableNavigableSet<E> of(E e1, E e2, E e3, E e4)
      Type Parameters:
      E -
      Parameters:
      e1 -
      e2 -
      e3 -
      e4 -
      Returns:
    • of

      public static <E extends Comparable<? super E>> ImmutableNavigableSet<E> of(E e1, E e2, E e3, E e4, E e5)
      Type Parameters:
      E -
      Parameters:
      e1 -
      e2 -
      e3 -
      e4 -
      e5 -
      Returns:
    • of

      public static <E extends Comparable<? super E>> ImmutableNavigableSet<E> of(E e1, E e2, E e3, E e4, E e5, E e6)
      Type Parameters:
      E -
      Parameters:
      e1 -
      e2 -
      e3 -
      e4 -
      e5 -
      e6 -
      Returns:
    • of

      public static <E extends Comparable<? super E>> ImmutableNavigableSet<E> of(E e1, E e2, E e3, E e4, E e5, E e6, E e7)
      Type Parameters:
      E -
      Parameters:
      e1 -
      e2 -
      e3 -
      e4 -
      e5 -
      e6 -
      e7 -
      Returns:
    • of

      public static <E extends Comparable<? super E>> ImmutableNavigableSet<E> of(E e1, E e2, E e3, E e4, E e5, E e6, E e7, E e8)
      Type Parameters:
      E -
      Parameters:
      e1 -
      e2 -
      e3 -
      e4 -
      e5 -
      e6 -
      e7 -
      e8 -
      Returns:
    • of

      public static <E extends Comparable<? super E>> ImmutableNavigableSet<E> of(E e1, E e2, E e3, E e4, E e5, E e6, E e7, E e8, E e9)
      Type Parameters:
      E -
      Parameters:
      e1 -
      e2 -
      e3 -
      e4 -
      e5 -
      e6 -
      e7 -
      e8 -
      e9 -
      Returns:
    • of

      public static <E extends Comparable<? super E>> ImmutableNavigableSet<E> of(E e1, E e2, E e3, E e4, E e5, E e6, E e7, E e8, E e9, E e10)
      Type Parameters:
      E -
      Parameters:
      e1 -
      e2 -
      e3 -
      e4 -
      e5 -
      e6 -
      e7 -
      e8 -
      e9 -
      e10 -
      Returns:
    • copyOf

      public static <E> ImmutableNavigableSet<E> copyOf(Collection<? extends E> c)
      Returns an ImmutableNavigableSet containing the elements of the specified collection. If the provided collection is already an instance of ImmutableNavigableSet, it is directly returned. If the provided collection is null or empty, an empty ImmutableNavigableSet is returned. Otherwise, a new ImmutableNavigableSet is created with the elements of the provided collection.
      Type Parameters:
      E - the type of elements in the collection
      Parameters:
      c - the collection whose elements are to be placed into this set
      Returns:
      an ImmutableNavigableSet containing the elements of the specified collection
    • wrap

      @Beta public static <E> ImmutableNavigableSet<E> wrap(NavigableSet<? extends E> navigableSet)
      Wraps the provided NavigableSet into an ImmutableNavigableSet. Changes to the specified NavigableSet will be reflected in the ImmutableNavigableSet. If the provided NavigableSet is already an instance of ImmutableNavigableSet, it is directly returned. If the provided NavigableSet is null, an empty ImmutableNavigableSet is returned. Otherwise, returns a new ImmutableNavigableSet backed by provided NavigableSet.
      Type Parameters:
      E - the type of elements in the NavigableSet
      Parameters:
      navigableSet - the NavigableSet to be wrapped into an ImmutableNavigableSet
      Returns:
      an ImmutableNavigableSet backed by the provided NavigableSet
    • wrap

      @Deprecated public static <E> ImmutableSortedSet<E> wrap(SortedSet<? extends E> sortedSet) throws UnsupportedOperationException
      Deprecated.
      throws UnsupportedOperationException
      This method is deprecated and will throw an UnsupportedOperationException if used.
      Type Parameters:
      E -
      Parameters:
      sortedSet -
      Returns:
      Throws:
      UnsupportedOperationException
    • lower

      public E lower(E e)
      Specified by:
      lower in interface NavigableSet<E>
      Parameters:
      e -
      Returns:
    • floor

      public E floor(E e)
      Specified by:
      floor in interface NavigableSet<E>
      Parameters:
      e -
      Returns:
    • ceiling

      public E ceiling(E e)
      Specified by:
      ceiling in interface NavigableSet<E>
      Parameters:
      e -
      Returns:
    • higher

      public E higher(E e)
      Specified by:
      higher in interface NavigableSet<E>
      Parameters:
      e -
      Returns:
    • pollFirst

      @Deprecated public E pollFirst() throws UnsupportedOperationException
      Deprecated.
      - UnsupportedOperationException
      Specified by:
      pollFirst in interface NavigableSet<E>
      Returns:
      Throws:
      UnsupportedOperationException
    • pollLast

      @Deprecated public E pollLast() throws UnsupportedOperationException
      Deprecated.
      - UnsupportedOperationException
      Specified by:
      pollLast in interface NavigableSet<E>
      Returns:
      Throws:
      UnsupportedOperationException
    • descendingSet

      public ImmutableNavigableSet<E> descendingSet()
      Specified by:
      descendingSet in interface NavigableSet<E>
    • descendingIterator

      public ObjIterator<E> descendingIterator()
      Specified by:
      descendingIterator in interface NavigableSet<E>
    • subSet

      public ImmutableNavigableSet<E> subSet(E fromElement, boolean fromInclusive, E toElement, boolean toInclusive)
      Specified by:
      subSet in interface NavigableSet<E>
      Parameters:
      fromElement -
      fromInclusive -
      toElement -
      toInclusive -
      Returns:
    • headSet

      public ImmutableNavigableSet<E> headSet(E toElement, boolean inclusive)
      Specified by:
      headSet in interface NavigableSet<E>
      Parameters:
      toElement -
      inclusive -
      Returns:
    • tailSet

      public ImmutableNavigableSet<E> tailSet(E fromElement, boolean inclusive)
      Specified by:
      tailSet in interface NavigableSet<E>
      Parameters:
      fromElement -
      inclusive -
      Returns: