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 classImmutableEnumSet.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 ImmutableSetasImmutable(EnumSet set) booleanbooleancontainsAll(Collection<?> collection) booleanvoidinthashCode()booleanisEmpty()(package private) booleanReturnstrueif thehashCode()method runs quickly.(package private) booleanReturnstrueif 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.intsize()toString()(package private) ObjectMethods inherited from class com.google.common.collect.ImmutableSet
builder, builderWithExpectedSize, chooseTableSize, copyOf, copyOf, copyOf, copyOf, of, of, of, of, of, of, of, toImmutableSetMethods inherited from class com.google.common.collect.ImmutableCollection
add, addAll, asList, clear, copyIntoArray, internalArray, internalArrayEnd, internalArrayStart, remove, removeAll, removeIf, retainAll, toArray, toArrayMethods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, waitMethods 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:ImmutableCollectionReturnstrueif 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 whethercopyOfimplementations should make an explicit copy to avoid memory leaks.- Specified by:
isPartialViewin classImmutableCollection<E extends Enum<E>>
-
iterator
Description copied from class:ImmutableCollectionReturns an unmodifiable iterator across the elements in this collection. -
spliterator
- Specified by:
spliteratorin interfaceCollection<E extends Enum<E>>- Specified by:
spliteratorin interfaceIterable<E extends Enum<E>>- Specified by:
spliteratorin interfaceSet<E extends Enum<E>>- Overrides:
spliteratorin classImmutableCollection<E extends Enum<E>>
-
forEach
-
size
public int size() -
contains
-
containsAll
- Specified by:
containsAllin interfaceCollection<E extends Enum<E>>- Specified by:
containsAllin interfaceSet<E extends Enum<E>>- Overrides:
containsAllin classAbstractCollection<E extends Enum<E>>
-
isEmpty
public boolean isEmpty() -
equals
-
isHashCodeFast
boolean isHashCodeFast()Description copied from class:ImmutableSetReturnstrueif thehashCode()method runs quickly.- Overrides:
isHashCodeFastin classImmutableSet<E extends Enum<E>>
-
hashCode
public int hashCode() -
toString
- Overrides:
toStringin classAbstractCollection<E extends Enum<E>>
-
writeReplace
Object writeReplace()- Overrides:
writeReplacein classImmutableSet<E extends Enum<E>>
-