final class ImmutableMapKeySet<K,V> extends IndexedImmutableSet<K>
keySet()
implementation for ImmutableMap
.Modifier and Type | Class and Description |
---|---|
private static class |
ImmutableMapKeySet.KeySetSerializedForm<K> |
ImmutableSet.Builder<E>, ImmutableSet.Indexed<E>
Modifier and Type | Field and Description |
---|---|
private ImmutableMap<K,V> |
map |
HASH_FLOODING_FPP, MAX_RUN_MULTIPLIER, MAX_TABLE_SIZE, SPLITERATOR_CHARACTERISTICS
Constructor and Description |
---|
ImmutableMapKeySet(ImmutableMap<K,V> map) |
Modifier and Type | Method and Description |
---|---|
boolean |
contains(java.lang.Object object) |
void |
forEach(java.util.function.Consumer<? super K> action) |
(package private) K |
get(int index) |
(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<K> |
iterator()
Returns an unmodifiable iterator across the elements in this collection.
|
int |
size() |
java.util.Spliterator<K> |
spliterator() |
copyIntoArray, createAsList
asList, builder, builderWithExpectedSize, chooseTableSize, copyOf, copyOf, copyOf, copyOf, equals, hashCode, hashFloodingDetected, isHashCodeFast, of, of, of, of, of, of, of, rebuildHashTable, toImmutableSet, writeReplace
add, addAll, clear, internalArray, internalArrayEnd, internalArrayStart, remove, removeAll, removeIf, retainAll, toArray, toArray
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
private final ImmutableMap<K,V> map
ImmutableMapKeySet(ImmutableMap<K,V> map)
public int size()
public UnmodifiableIterator<K> iterator()
ImmutableCollection
public java.util.Spliterator<K> spliterator()
spliterator
in interface java.lang.Iterable<K>
spliterator
in interface java.util.Collection<K>
spliterator
in interface java.util.Set<K>
spliterator
in class IndexedImmutableSet<K>
public boolean contains(java.lang.Object object)
contains
in interface java.util.Collection<K>
contains
in interface java.util.Set<K>
contains
in class ImmutableCollection<K>
K get(int index)
get
in class IndexedImmutableSet<K>
public void forEach(java.util.function.Consumer<? super K> action)
forEach
in interface java.lang.Iterable<K>
forEach
in class IndexedImmutableSet<K>
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<K>