Package com.google.common.collect
Class JdkBackedImmutableSet<E>
- java.lang.Object
-
- java.util.AbstractCollection<E>
-
- com.google.common.collect.ImmutableCollection<E>
-
- com.google.common.collect.ImmutableSet<E>
-
- com.google.common.collect.IndexedImmutableSet<E>
-
- com.google.common.collect.JdkBackedImmutableSet<E>
-
- All Implemented Interfaces:
java.io.Serializable
,java.lang.Iterable<E>
,java.util.Collection<E>
,java.util.Set<E>
@GwtCompatible(serializable=true) final class JdkBackedImmutableSet<E> extends IndexedImmutableSet<E>
ImmutableSet implementation backed by a JDK HashSet, used to defend against apparent hash flooding. This implementation is never used on the GWT client side, but it must be present there for serialization to work.
-
-
Nested Class Summary
-
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 java.util.Set<?>
delegate
private ImmutableList<E>
delegateList
-
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 JdkBackedImmutableSet(java.util.Set<?> delegate, ImmutableList<E> delegateList)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description boolean
contains(java.lang.Object object)
(package private) E
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.int
size()
-
Methods inherited from class com.google.common.collect.IndexedImmutableSet
copyIntoArray, createAsList, forEach, iterator, spliterator
-
Methods inherited from class com.google.common.collect.ImmutableSet
asList, builder, builderWithExpectedSize, chooseTableSize, copyOf, copyOf, copyOf, copyOf, equals, hashCode, hashFloodingDetected, isHashCodeFast, maxRunBeforeFallback, of, of, of, of, of, of, of, rebuildHashTable, toImmutableSet, writeReplace
-
Methods inherited from class com.google.common.collect.ImmutableCollection
add, addAll, clear, remove, removeAll, removeIf, retainAll, toArray, toArray
-
-
-
-
Field Detail
-
delegate
private final java.util.Set<?> delegate
-
delegateList
private final ImmutableList<E> delegateList
-
-
Constructor Detail
-
JdkBackedImmutableSet
JdkBackedImmutableSet(java.util.Set<?> delegate, ImmutableList<E> delegateList)
-
-
Method Detail
-
get
E get(int index)
- Specified by:
get
in classIndexedImmutableSet<E>
-
contains
public boolean contains(java.lang.Object object)
- Specified by:
contains
in interfacejava.util.Collection<E>
- Specified by:
contains
in interfacejava.util.Set<E>
- Specified by:
contains
in classImmutableCollection<E>
-
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<E>
-
-