Package com.google.common.collect
Class ImmutableMapKeySet<K,V>
- java.lang.Object
-
- java.util.AbstractCollection<E>
-
- com.google.common.collect.ImmutableCollection<E>
-
- com.google.common.collect.ImmutableSet<E>
-
- com.google.common.collect.IndexedImmutableSet<K>
-
- com.google.common.collect.ImmutableMapKeySet<K,V>
-
- All Implemented Interfaces:
java.io.Serializable
,java.lang.Iterable<K>
,java.util.Collection<K>
,java.util.Set<K>
@GwtCompatible(emulated=true) final class ImmutableMapKeySet<K,V> extends IndexedImmutableSet<K>
keySet()
implementation forImmutableMap
.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description private static class
ImmutableMapKeySet.KeySetSerializedForm<K>
-
Nested classes/interfaces inherited from class com.google.common.collect.ImmutableSet
ImmutableSet.Builder<E>, ImmutableSet.Indexed<E>
-
-
Field Summary
Fields Modifier and Type Field Description private ImmutableMap<K,V>
map
-
Fields inherited from class com.google.common.collect.ImmutableSet
HASH_FLOODING_FPP, MAX_RUN_MULTIPLIER, MAX_TABLE_SIZE, SPLITERATOR_CHARACTERISTICS
-
-
Constructor Summary
Constructors Constructor Description ImmutableMapKeySet(ImmutableMap<K,V> map)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method 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()
Returnstrue
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()
(package private) java.lang.Object
writeReplace()
-
Methods inherited from class com.google.common.collect.IndexedImmutableSet
copyIntoArray, createAsList
-
Methods inherited from class com.google.common.collect.ImmutableSet
asList, builder, builderWithExpectedSize, chooseTableSize, copyOf, copyOf, copyOf, copyOf, equals, hashCode, hashFloodingDetected, isHashCodeFast, of, of, of, of, of, of, of, rebuildHashTable, toImmutableSet
-
Methods inherited from class com.google.common.collect.ImmutableCollection
add, addAll, clear, internalArray, internalArrayEnd, internalArrayStart, remove, removeAll, removeIf, retainAll, toArray, toArray
-
-
-
-
Field Detail
-
map
private final ImmutableMap<K,V> map
-
-
Constructor Detail
-
ImmutableMapKeySet
ImmutableMapKeySet(ImmutableMap<K,V> map)
-
-
Method Detail
-
size
public int size()
-
iterator
public UnmodifiableIterator<K> iterator()
Description copied from class:ImmutableCollection
Returns an unmodifiable iterator across the elements in this collection.
-
spliterator
public java.util.Spliterator<K> spliterator()
- Specified by:
spliterator
in interfacejava.util.Collection<K>
- Specified by:
spliterator
in interfacejava.lang.Iterable<K>
- Specified by:
spliterator
in interfacejava.util.Set<K>
- Overrides:
spliterator
in classIndexedImmutableSet<K>
-
contains
public boolean contains(java.lang.Object object)
- Specified by:
contains
in interfacejava.util.Collection<K>
- Specified by:
contains
in interfacejava.util.Set<K>
- Specified by:
contains
in classImmutableCollection<K>
-
get
K get(int index)
- Specified by:
get
in classIndexedImmutableSet<K>
-
forEach
public void forEach(java.util.function.Consumer<? super K> action)
- Specified by:
forEach
in interfacejava.lang.Iterable<K>
- Overrides:
forEach
in classIndexedImmutableSet<K>
-
isPartialView
boolean isPartialView()
Description copied from class:ImmutableCollection
Returnstrue
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 whethercopyOf
implementations should make an explicit copy to avoid memory leaks.- Specified by:
isPartialView
in classImmutableCollection<K>
-
writeReplace
@GwtIncompatible java.lang.Object writeReplace()
- Overrides:
writeReplace
in classImmutableSet<K>
-
-