NavigableSet whose contents will never change, with many other important properties
detailed at ImmutableCollection.Warning
as with any sorted collection, you are strongly advised not to use a Comparator or Comparable type whose comparison behavior is inconsistent with
equals. That is, a.compareTo(b) or comparator.compare(a, b) should equal zero
if and only if a.equals(b). If this advice is not followed, the resulting
collection will not correctly obey its specification.
See the Guava User Guide article on immutable collections.
NavigableSet since 12.0)
| Modifier and Type | Class and Description |
|---|---|
| public static class | ImmutableSortedSet.
A builder for creating immutable sorted set instances, especially |
| private static class |
| Modifier and Type | Field and Description |
|---|---|
| pack-priv final transient Comparator | |
| pack-priv transient ImmutableSortedSet | |
| private static final long | |
| pack-priv static final int |
| Access | Constructor and Description |
|---|---|
| pack-priv |
| Modifier and Type | Method and Description |
|---|---|
| public static <E> ImmutableSortedSet. | builder()
Hides com.
Deprecated
Use
Not supported.
ImmutableSortedSet#naturalOrder, which offers better type-safety.
|
| public static <E> ImmutableSortedSet. | builderWithExpectedSize(int expectedSize)
Hides com.
Deprecated
Not supported by ImmutableSortedSet.
Not supported.
|
| public E | ceiling(E
the value to match e)Implements java. null if there is no such element.
|
| public Comparator | comparator()
Implements java. Ordering#natural() when the
natural ordering of the elements is used.
|
| pack-priv static <E> ImmutableSortedSet | construct(Comparator<? super E> comparator, int n, E... contents)
Constructs an |
| public static <E extends Comparable | copyOf(E[] elements)
Returns an immutable sorted set containing the given elements sorted by their natural ordering.
|
| public static <E> ImmutableSortedSet | |
| public static <E> ImmutableSortedSet | copyOf(Collection<? extends E>
a elements)Collection from which elements are drawn, must be non-nullHides com. |
| public static <E> ImmutableSortedSet | |
| public static <E> ImmutableSortedSet | copyOf(Comparator<? super E> comparator, Iterator<? extends E> elements)
Returns an immutable sorted set containing the given elements sorted by the given |
| public static <E> ImmutableSortedSet | copyOf(Comparator<? super E> comparator, Iterable<? extends E> elements)
Returns an immutable sorted set containing the given elements sorted by the given |
| public static <E> ImmutableSortedSet | copyOf(Comparator<? super E> comparator, Collection<? extends E> elements)
Returns an immutable sorted set containing the given elements sorted by the given |
| public static <Z> ImmutableSortedSet | copyOf(Z[] elements)
Hides com.
Deprecated
Pass parameters of type
Not supported.
Comparable to use ImmutableSortedSet#copyOf(Comparable[]).
|
| public static <E> ImmutableSortedSet | copyOfSorted(SortedSet<E> sortedSet)
Returns an immutable sorted set containing the elements of a sorted set, sorted by the same
|
| pack-priv abstract ImmutableSortedSet | |
| public abstract UnmodifiableIterator | descendingIterator()
Redeclares java. |
| public ImmutableSortedSet | descendingSet()
Implements java. |
| pack-priv static <E> RegularImmutableSortedSet | |
| public E | first()
Implements java. |
| public E | floor(E
the value to match e)Implements java. null if there is no such element.
|
| public ImmutableSortedSet | headSet(E
high endpoint (exclusive) of the returned set toElement)Implements java. toElement.
|
| public ImmutableSortedSet | headSet(E
high endpoint of the returned set toElement, boolean true if the high endpoint
is to be included in the returned viewImplements java. inclusive is true) toElement.
|
| pack-priv abstract ImmutableSortedSet | |
| public E | higher(E
the value to match e)Implements java. null if there is no such element.
|
| pack-priv abstract int | |
| public abstract UnmodifiableIterator | iterator()
Redeclares java. Implements abstract com. |
| public E | last()
Implements java. |
| public E | lower(E
the value to match e)Implements java. null if there is no such element.
|
| public static <E extends Comparable | naturalOrder()
Returns a builder that creates immutable sorted sets whose elements are ordered by their natural ordering. |
| public static <E> ImmutableSortedSet | of()
Hides com. |
| public static <E extends Comparable | of(E
the single element element)Hides com. |
| public static <E extends Comparable | of(E
the first element e1, E the second element e2)Hides com. |
| public static <E extends Comparable | of(E
the first element e1, E the second element e2, E the third element e3)Hides com. |
| public static <E extends Comparable | of(E
the first element e1, E the second element e2, E the third element e3, E the fourth element e4)Hides com. |
| public static <E extends Comparable | of(E
the first element e1, E the second element e2, E the third element e3, E the fourth element e4, E the fifth element e5)Hides com. |
| public static <E extends Comparable | of(E
the first element e1, E the second element e2, E the third element e3, E the fourth element e4, E the fifth element e5, E the sixth element e6, E... the seventh element remaining)Hides com. |
| public static <E> ImmutableSortedSet | of(E
the single element element)Hides com.
Deprecated
Pass a parameter of type
Not supported.
Comparable to use ImmutableSortedSet#of(Comparable).
|
| public static <E> ImmutableSortedSet | of(E
the first element e1, E the second element e2)Hides com.
Deprecated
Pass the parameters of type
Not supported.
Comparable to use ImmutableSortedSet#of(Comparable, Comparable).
|
| public static <E> ImmutableSortedSet | of(E
the first element e1, E the second element e2, E the third element e3)Hides com.
Deprecated
Pass the parameters of type
Not supported.
Comparable to use ImmutableSortedSet#of(Comparable, Comparable, Comparable).
|
| public static <E> ImmutableSortedSet | of(E
the first element e1, E the second element e2, E the third element e3, E the fourth element e4)Hides com.
Deprecated
Pass the parameters of type
Not supported.
Comparable to use ImmutableSortedSet#of(Comparable, Comparable, Comparable, Comparable).
|
| public static <E> ImmutableSortedSet | of(E
the first element e1, E the second element e2, E the third element e3, E the fourth element e4, E the fifth element e5)Hides com.
Deprecated
Pass the parameters of type
Not supported.
Comparable to use ImmutableSortedSet#of(Comparable, Comparable, Comparable, Comparable, Comparable).
|
| public static <E> ImmutableSortedSet | of(E
the first element e1, E the second element e2, E the third element e3, E the fourth element e4, E the fifth element e5, E the sixth element e6, E... the seventh element remaining)Hides com.
Deprecated
Pass the parameters of type
Not supported.
Comparable to use ImmutableSortedSet#of(Comparable, Comparable, Comparable, Comparable, Comparable,
Comparable, Comparable..
|
| public static <E> ImmutableSortedSet. | orderedBy(Comparator<E> comparator)
Returns a builder that creates immutable sorted sets with an explicit comparator. |
| public final E | pollFirst()
Implements java.
Deprecated
Unsupported operation.
Guaranteed to throw an exception and leave the set unmodified.
|
| public final E | pollLast()
Implements java.
Deprecated
Unsupported operation.
Guaranteed to throw an exception and leave the set unmodified.
|
| private void | |
| public static <E extends Comparable | reverseOrder()
Returns a builder that creates immutable sorted sets whose elements are ordered by the reverse of their natural ordering. |
| public Spliterator | spliterator()
Overrides com. Overrides default java. Spliterator over the elements in this sorted set.
|
| public ImmutableSortedSet | subSet(E
low endpoint (inclusive) of the returned set fromElement, E high endpoint (exclusive) of the returned set toElement)Implements java. fromElement, inclusive, to toElement,
exclusive.
|
| public ImmutableSortedSet | subSet(E
low endpoint of the returned set fromElement, boolean true if the low endpoint
is to be included in the returned viewhigh endpoint of the returned set toElement, boolean true if the high endpoint
is to be included in the returned viewImplements java. fromElement to toElement.
|
| pack-priv abstract ImmutableSortedSet | |
| public ImmutableSortedSet | tailSet(E
low endpoint (inclusive) of the returned set fromElement)Implements java. fromElement.
|
| public ImmutableSortedSet | tailSet(E
low endpoint of the returned set fromElement, boolean true if the low endpoint
is to be included in the returned viewImplements java. inclusive is true) fromElement.
|
| pack-priv abstract ImmutableSortedSet | |
| public static <E> Collector | toImmutableSet()
Hides com.
Deprecated
Use
Not supported.
ImmutableSortedSet#toImmutableSortedSet.
|
| public static <E> Collector | toImmutableSortedSet(Comparator<? super E> comparator)
Returns a |
| pack-priv int | |
| pack-priv static int | |
| pack-priv Object |