Package com.google.common.collect
Class ImmutableEnumSet<E extends Enum<E>>
java.lang.Object
java.util.AbstractCollection<E>
com.google.common.collect.ImmutableCollection<E>
com.google.common.collect.ImmutableSet<E>
com.google.common.collect.ImmutableEnumSet<E>
- All Implemented Interfaces:
Serializable
,Iterable<E>
,Collection<E>
,Set<E>
Implementation of
ImmutableSet
backed by a non-empty EnumSet
.-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionprivate static class
ImmutableEnumSet.EnumSerializedForm<E extends Enum<E>>
Nested classes/interfaces inherited from class com.google.common.collect.ImmutableSet
ImmutableSet.Builder<E>, ImmutableSet.CachingAsList<E>, ImmutableSet.Indexed<E>
-
Field Summary
FieldsFields inherited from class com.google.common.collect.ImmutableSet
MAX_TABLE_SIZE, SPLITERATOR_CHARACTERISTICS
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescription(package private) static <E extends Enum<E>>
ImmutableSet<E> asImmutable
(EnumSet<E> set) boolean
boolean
containsAll
(Collection<?> collection) boolean
void
int
hashCode()
boolean
isEmpty()
(package private) boolean
Returnstrue
if thehashCode()
method runs quickly.(package private) boolean
Returnstrue
if this immutable collection's implementation contains references to user-created objects that aren't accessible via this collection's methods.iterator()
Returns an unmodifiable iterator across the elements in this collection.private void
readObject
(ObjectInputStream stream) int
size()
toString()
(package private) Object
Methods inherited from class com.google.common.collect.ImmutableSet
builder, builderWithExpectedSize, chooseTableSize, copyOf, copyOf, copyOf, copyOf, of, of, of, of, of, of, of, toImmutableSet
Methods inherited from class com.google.common.collect.ImmutableCollection
add, addAll, asList, clear, copyIntoArray, internalArray, internalArrayEnd, internalArrayStart, remove, removeAll, removeIf, retainAll, toArray, toArray
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
Methods inherited from interface java.util.Collection
parallelStream, removeIf, stream, toArray
-
Field Details
-
delegate
-
hashCode
private transient int hashCode
-
-
Constructor Details
-
ImmutableEnumSet
-
-
Method Details
-
asImmutable
-
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 extends Enum<E>>
-
iterator
Description copied from class:ImmutableCollection
Returns an unmodifiable iterator across the elements in this collection. -
spliterator
- Specified by:
spliterator
in interfaceCollection<E extends Enum<E>>
- Specified by:
spliterator
in interfaceIterable<E extends Enum<E>>
- Specified by:
spliterator
in interfaceSet<E extends Enum<E>>
- Overrides:
spliterator
in classImmutableCollection<E extends Enum<E>>
-
forEach
-
size
public int size() -
contains
-
containsAll
- Specified by:
containsAll
in interfaceCollection<E extends Enum<E>>
- Specified by:
containsAll
in interfaceSet<E extends Enum<E>>
- Overrides:
containsAll
in classAbstractCollection<E extends Enum<E>>
-
isEmpty
public boolean isEmpty() -
equals
-
isHashCodeFast
boolean isHashCodeFast()Description copied from class:ImmutableSet
Returnstrue
if thehashCode()
method runs quickly.- Overrides:
isHashCodeFast
in classImmutableSet<E extends Enum<E>>
-
hashCode
public int hashCode() -
toString
- Overrides:
toString
in classAbstractCollection<E extends Enum<E>>
-
writeReplace
Object writeReplace()- Overrides:
writeReplace
in classImmutableSet<E extends Enum<E>>
-
readObject
- Throws:
InvalidObjectException
-