Top Description Inners Fields Constructors Methods
com.google.common.collect

pack-priv final Class ImmutableMapKeySet<K, V>

extends IndexedImmutableSet<K>
Class Inheritance
Annotations
@GwtCompatible
emulated:true
@ElementTypesAreNonnullByDefault
Static Imports
com.google.common.base.Preconditions.checkNotNull

keySet() implementation for ImmutableMap.
Authors
Jesse Wilson, Kevin Bourrillion

Nested and Inner Type Summary

Modifier and TypeClass and Description
private static class

Field Summary

Modifier and TypeField and Description
private final ImmutableMap<K, V>

Constructor Summary

AccessConstructor and Description
pack-priv

Method Summary

Modifier and TypeMethod and Description
public boolean
contains(Object
element whose presence in this set is to be tested
object
)

Implements abstract com.google.common.collect.ImmutableCollection.contains.

Implements java.util.Set.contains, java.util.Collection.contains.

Returns true if this set contains the specified element.
public void
forEach(Consumer<? super K>
The action to be performed for each element
action
)

Overrides com.google.common.collect.IndexedImmutableSet.forEach.

Overrides default java.lang.Iterable.forEach.

Performs the given action for each element of the Iterable until all elements have been processed or the action throws an exception.
pack-priv K
pack-priv boolean
isPartialView()

Implements abstract com.google.common.collect.ImmutableCollection.isPartialView.

Returns true if this immutable collection's implementation contains references to user-created objects that aren't accessible via this collection's methods.
public UnmodifiableIterator<K>
iterator()

Overrides com.google.common.collect.IndexedImmutableSet.iterator.

Implements java.util.Set.iterator, java.util.Collection.iterator.

Returns an iterator over the elements in this set.
public int
size()

Implements abstract java.util.AbstractCollection.size.

Implements java.util.Set.size, java.util.Collection.size.

Returns the number of elements in this set (its cardinality).
public Spliterator<K>
spliterator()

Overrides com.google.common.collect.IndexedImmutableSet.spliterator.

Overrides default java.util.Set.spliterator, java.util.Collection.spliterator.

Creates a Spliterator over the elements in this set.
Inherited from com.google.common.collect.IndexedImmutableSet:
copyIntoArraycreateAsList

Field Detail

mapback to summary
private final ImmutableMap<K, V> map

Constructor Detail

ImmutableMapKeySetback to summary
pack-priv ImmutableMapKeySet(ImmutableMap<K, V> map)

Method Detail

containsback to summary
public boolean contains(Object object)

Implements abstract com.google.common.collect.ImmutableCollection.contains.

Implements java.util.Set.contains, java.util.Collection.contains.

Doc from java.util.Set.contains.

Returns true if this set contains the specified element. More formally, returns true if and only if this set contains an element e such that Objects.equals(o, e).

Parameters
object:Object

element whose presence in this set is to be tested

Returns:boolean

true if this set contains the specified element

Annotations
@Override
forEachback to summary
public void forEach(Consumer<? super K> action)

Overrides com.google.common.collect.IndexedImmutableSet.forEach.

Overrides default java.lang.Iterable.forEach.

Doc from java.lang.Iterable.forEach.

Performs the given action for each element of the Iterable until all elements have been processed or the action throws an exception. Actions are performed in the order of iteration, if that order is specified. Exceptions thrown by the action are relayed to the caller.

The behavior of this method is unspecified if the action performs side-effects that modify the underlying source of elements, unless an overriding class has specified a concurrent modification policy.

Parameters
action:Consumer<? super K>

The action to be performed for each element

Annotations
@Override
getback to summary
pack-priv K get(int index)

Implements abstract com.google.common.collect.IndexedImmutableSet.get.

Annotations
@Override
isPartialViewback to summary
pack-priv boolean isPartialView()

Implements abstract com.google.common.collect.ImmutableCollection.isPartialView.

Doc from com.google.common.collect.ImmutableCollection.isPartialView.

Returns 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.

Annotations
@Override
iteratorback to summary
public UnmodifiableIterator<K> iterator()

Overrides com.google.common.collect.IndexedImmutableSet.iterator.

Implements java.util.Set.iterator, java.util.Collection.iterator.

Doc from java.util.Set.iterator.

Returns an iterator over the elements in this set. The elements are returned in no particular order (unless this set is an instance of some class that provides a guarantee).

Returns:UnmodifiableIterator<K>

an iterator over the elements in this set

Annotations
@Override
sizeback to summary
public int size()

Implements abstract java.util.AbstractCollection.size.

Implements java.util.Set.size, java.util.Collection.size.

Doc from java.util.Set.size.

Returns the number of elements in this set (its cardinality). If this set contains more than Integer.MAX_VALUE elements, returns Integer.MAX_VALUE.

Returns:int

the number of elements in this set (its cardinality)

Annotations
@Override
spliteratorback to summary
public Spliterator<K> spliterator()

Overrides com.google.common.collect.IndexedImmutableSet.spliterator.

Overrides default java.util.Set.spliterator, java.util.Collection.spliterator.

Doc from java.util.Set.spliterator.

Creates a Spliterator over the elements in this set.

The Spliterator reports Spliterator#DISTINCT. Implementations should document the reporting of additional characteristic values.

Returns:Spliterator<K>

a Spliterator over the elements in this set

Annotations
@Override
com.google.common.collect back to summary

private Class ImmutableMapKeySet.KeySetSerializedForm<K>

extends Object
implements Serializable
Class Inheritance
  • java.lang.Object
  • com.google.common.collect.ImmutableMapKeySet.KeySetSerializedForm
All Implemented Interfaces
java.io.Serializable
Annotations
@GwtIncompatible
@J2ktIncompatible
@SuppressWarnings:unused

Field Summary

Modifier and TypeField and Description
pack-priv final ImmutableMap<K, ?>
private static final long

Constructor Summary

AccessConstructor and Description
pack-priv

Method Summary

Modifier and TypeMethod and Description
pack-priv Object
Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Field Detail

mapback to summary
pack-priv final ImmutableMap<K, ?> map
serialVersionUIDback to summary
private static final long serialVersionUID

Constructor Detail

KeySetSerializedFormback to summary
pack-priv KeySetSerializedForm(ImmutableMap<K, ?> map)

Method Detail

readResolveback to summary
pack-priv Object readResolve()