@GwtCompatible(serializable=true, emulated=true) final class RegularImmutableSortedSet<E> extends ImmutableSortedSet<E>
ImmutableSortedSet.Builder<E>
ImmutableSet.Indexed<E>
Modifier and Type | Field and Description |
---|---|
private ImmutableList<E> |
elements |
(package private) static RegularImmutableSortedSet<java.lang.Comparable> |
NATURAL_EMPTY_SET |
comparator, descendingSet, SPLITERATOR_CHARACTERISTICS
HASH_FLOODING_FPP, MAX_RUN_MULTIPLIER, MAX_TABLE_SIZE
Constructor and Description |
---|
RegularImmutableSortedSet(ImmutableList<E> elements,
java.util.Comparator<? super E> comparator) |
Modifier and Type | Method and Description |
---|---|
E |
ceiling(E element) |
boolean |
contains(java.lang.Object o) |
boolean |
containsAll(java.util.Collection<?> targets) |
(package private) int |
copyIntoArray(java.lang.Object[] dst,
int offset)
Copies the contents of this immutable collection into the specified array at the specified
offset.
|
(package private) ImmutableList<E> |
createAsList() |
(package private) ImmutableSortedSet<E> |
createDescendingSet() |
UnmodifiableIterator<E> |
descendingIterator() |
boolean |
equals(java.lang.Object object) |
E |
first() |
E |
floor(E element) |
void |
forEach(java.util.function.Consumer<? super E> action) |
(package private) RegularImmutableSortedSet<E> |
getSubSet(int newFromIndex,
int newToIndex) |
(package private) int |
headIndex(E toElement,
boolean inclusive) |
(package private) ImmutableSortedSet<E> |
headSetImpl(E toElement,
boolean inclusive) |
E |
higher(E element) |
(package private) int |
indexOf(java.lang.Object target)
Returns the position of an element within the set, or -1 if not present.
|
(package private) boolean |
isPartialView()
Returns
true if this immutable collection's implementation contains references to
user-created objects that aren't accessible via this collection's methods. |
UnmodifiableIterator<E> |
iterator()
Returns an unmodifiable iterator across the elements in this collection.
|
E |
last() |
E |
lower(E element) |
int |
size() |
java.util.Spliterator<E> |
spliterator() |
(package private) ImmutableSortedSet<E> |
subSetImpl(E fromElement,
boolean fromInclusive,
E toElement,
boolean toInclusive) |
(package private) int |
tailIndex(E fromElement,
boolean inclusive) |
(package private) ImmutableSortedSet<E> |
tailSetImpl(E fromElement,
boolean inclusive) |
private int |
unsafeBinarySearch(java.lang.Object key) |
(package private) java.util.Comparator<java.lang.Object> |
unsafeComparator() |
comparator, construct, copyOf, copyOf, copyOf, copyOf, copyOf, copyOf, copyOf, copyOfSorted, descendingSet, emptySet, headSet, headSet, naturalOrder, of, of, of, of, of, of, of, orderedBy, pollFirst, pollLast, reverseOrder, subSet, subSet, tailSet, tailSet, toImmutableSortedSet, unsafeCompare, unsafeCompare, writeReplace
builder, builderWithExpectedSize, toImmutableSet
asList, chooseTableSize, hashCode, hashFloodingDetected, isHashCodeFast, maxRunBeforeFallback, rebuildHashTable
add, addAll, clear, remove, removeAll, removeIf, retainAll, toArray, toArray
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
static final RegularImmutableSortedSet<java.lang.Comparable> NATURAL_EMPTY_SET
private final transient ImmutableList<E> elements
RegularImmutableSortedSet(ImmutableList<E> elements, java.util.Comparator<? super E> comparator)
public UnmodifiableIterator<E> iterator()
ImmutableCollection
iterator
in interface SortedIterable<E>
iterator
in interface java.lang.Iterable<E>
iterator
in interface java.util.Collection<E>
iterator
in interface java.util.NavigableSet<E>
iterator
in interface java.util.Set<E>
iterator
in class ImmutableSortedSet<E>
@GwtIncompatible public UnmodifiableIterator<E> descendingIterator()
descendingIterator
in interface java.util.NavigableSet<E>
descendingIterator
in class ImmutableSortedSet<E>
public java.util.Spliterator<E> spliterator()
spliterator
in interface java.lang.Iterable<E>
spliterator
in interface java.util.Collection<E>
spliterator
in interface java.util.Set<E>
spliterator
in interface java.util.SortedSet<E>
spliterator
in class ImmutableSortedSet<E>
public void forEach(java.util.function.Consumer<? super E> action)
public int size()
public boolean contains(java.lang.Object o)
contains
in interface java.util.Collection<E>
contains
in interface java.util.Set<E>
contains
in class ImmutableCollection<E>
public boolean containsAll(java.util.Collection<?> targets)
private int unsafeBinarySearch(java.lang.Object key) throws java.lang.ClassCastException
java.lang.ClassCastException
boolean isPartialView()
ImmutableCollection
true
if this immutable collection's implementation contains references to
user-created objects that aren't accessible via this collection's methods. This is generally
used to determine whether copyOf
implementations should make an explicit copy to avoid
memory leaks.isPartialView
in class ImmutableCollection<E>
int copyIntoArray(java.lang.Object[] dst, int offset)
ImmutableCollection
offset + size()
.copyIntoArray
in class ImmutableCollection<E>
public boolean equals(java.lang.Object object)
equals
in interface java.util.Collection<E>
equals
in interface java.util.Set<E>
equals
in class ImmutableSet<E>
public E first()
first
in interface java.util.SortedSet<E>
first
in class ImmutableSortedSet<E>
public E last()
last
in interface java.util.SortedSet<E>
last
in class ImmutableSortedSet<E>
public E lower(E element)
lower
in interface java.util.NavigableSet<E>
lower
in class ImmutableSortedSet<E>
public E floor(E element)
floor
in interface java.util.NavigableSet<E>
floor
in class ImmutableSortedSet<E>
public E ceiling(E element)
ceiling
in interface java.util.NavigableSet<E>
ceiling
in class ImmutableSortedSet<E>
public E higher(E element)
higher
in interface java.util.NavigableSet<E>
higher
in class ImmutableSortedSet<E>
ImmutableSortedSet<E> headSetImpl(E toElement, boolean inclusive)
headSetImpl
in class ImmutableSortedSet<E>
int headIndex(E toElement, boolean inclusive)
ImmutableSortedSet<E> subSetImpl(E fromElement, boolean fromInclusive, E toElement, boolean toInclusive)
subSetImpl
in class ImmutableSortedSet<E>
ImmutableSortedSet<E> tailSetImpl(E fromElement, boolean inclusive)
tailSetImpl
in class ImmutableSortedSet<E>
int tailIndex(E fromElement, boolean inclusive)
java.util.Comparator<java.lang.Object> unsafeComparator()
RegularImmutableSortedSet<E> getSubSet(int newFromIndex, int newToIndex)
int indexOf(java.lang.Object target)
ImmutableSortedSet
indexOf
in class ImmutableSortedSet<E>
ImmutableList<E> createAsList()
createAsList
in class ImmutableSet<E>
ImmutableSortedSet<E> createDescendingSet()
createDescendingSet
in class ImmutableSortedSet<E>