Class ImmutableSortedSet<E>

Type Parameters:
E -
All Implemented Interfaces:
Immutable, Iterable<E>, Collection<E>, Set<E>, SortedSet<E>
Direct Known Subclasses:
ImmutableNavigableSet

public class ImmutableSortedSet<E> extends ImmutableSet<E> implements SortedSet<E>
Since:
1.1.4
Author:
Haiyang Li
  • Method Details

    • empty

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

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

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

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

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

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

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

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

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

      public static <E> ImmutableSortedSet<E> copyOf(SortedSet<? extends E> sortedSet)
      Type Parameters:
      E -
      Parameters:
      sortedSet -
      Returns:
    • wrap

      @Deprecated public static <E> ImmutableSortedSet<E> wrap(SortedSet<? extends E> sortedSet)
      Deprecated.
      the ImmutableSortedSet may be modified through the specified sortedSet
      Type Parameters:
      E -
      Parameters:
      sortedSet -
      Returns:
      an ImmutableSortedSet backed by the specified sortedSet
    • wrap

      @Deprecated public static <E> ImmutableSet<E> wrap(Set<? extends E> set) throws UnsupportedOperationException
      Deprecated.
      throws UnsupportedOperationException
      Type Parameters:
      E -
      Parameters:
      set -
      Returns:
      Throws:
      UnsupportedOperationException
    • comparator

      public Comparator<? super E> comparator()
      Specified by:
      comparator in interface SortedSet<E>
      Returns:
    • subSet

      public ImmutableSortedSet<E> subSet(E fromElement, E toElement)
      Specified by:
      subSet in interface SortedSet<E>
      Parameters:
      fromElement -
      toElement -
      Returns:
    • headSet

      public ImmutableSortedSet<E> headSet(E toElement)
      Specified by:
      headSet in interface SortedSet<E>
      Parameters:
      toElement -
      Returns:
    • tailSet

      public ImmutableSortedSet<E> tailSet(E fromElement)
      Specified by:
      tailSet in interface SortedSet<E>
      Parameters:
      fromElement -
      Returns:
    • first

      public E first()
      Specified by:
      first in interface SortedSet<E>
      Returns:
    • last

      public E last()
      Specified by:
      last in interface SortedSet<E>
      Returns: