Class SingletonImmutableSet<E>
java.lang.Object
java.util.AbstractCollection<E>
org.docx4j.com.google.common.collect.ImmutableCollection<E>
org.docx4j.com.google.common.collect.ImmutableSet<E>
org.docx4j.com.google.common.collect.SingletonImmutableSet<E>
- All Implemented Interfaces:
Serializable,Iterable<E>,Collection<E>,Set<E>
@GwtCompatible(serializable=true,
emulated=true)
final class SingletonImmutableSet<E>
extends ImmutableSet<E>
Implementation of
ImmutableSet with exactly one element.-
Nested Class Summary
Nested classes/interfaces inherited from class org.docx4j.com.google.common.collect.ImmutableSet
ImmutableSet.Builder<E> -
Field Summary
FieldsFields inherited from class org.docx4j.com.google.common.collect.ImmutableSet
HASH_FLOODING_FPP, MAX_RUN_MULTIPLIER, MAX_TABLE_SIZE, SPLITERATOR_CHARACTERISTICS -
Constructor Summary
ConstructorsConstructorDescriptionSingletonImmutableSet(E element) SingletonImmutableSet(E element, int hashCode) -
Method Summary
Modifier and TypeMethodDescriptionboolean(package private) intcopyIntoArray(Object[] dst, int offset) Copies the contents of this immutable collection into the specified array at the specified offset.final inthashCode()(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()Methods inherited from class org.docx4j.com.google.common.collect.ImmutableSet
builder, builderWithExpectedSize, chooseTableSize, copyOf, copyOf, copyOf, copyOf, equals, hashFloodingDetected, of, of, of, of, of, of, of, rebuildHashTable, writeReplaceMethods inherited from class org.docx4j.com.google.common.collect.ImmutableCollection
add, addAll, clear, internalArray, internalArrayEnd, internalArrayStart, remove, removeAll, removeIf, retainAll, spliterator, toArray, toArrayMethods inherited from class java.util.AbstractCollection
containsAll, isEmptyMethods 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
-
element
-
cachedHashCode
private transient int cachedHashCode
-
-
Constructor Details
-
Method Details
-
size
public int size()- Specified by:
sizein interfaceCollection<E>- Specified by:
sizein interfaceSet<E>- Specified by:
sizein classAbstractCollection<E>
-
contains
- Specified by:
containsin interfaceCollection<E>- Specified by:
containsin interfaceSet<E>- Specified by:
containsin classImmutableCollection<E>
-
iterator
Description copied from class:ImmutableCollectionReturns an unmodifiable iterator across the elements in this collection. -
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>
-
copyIntoArray
Description copied from class:ImmutableCollectionCopies the contents of this immutable collection into the specified array at the specified offset. Returnsoffset + size().- Overrides:
copyIntoArrayin classImmutableCollection<E>
-
hashCode
public final int hashCode()- Specified by:
hashCodein interfaceCollection<E>- Specified by:
hashCodein interfaceSet<E>- Overrides:
hashCodein classImmutableSet<E>
-
isHashCodeFast
boolean isHashCodeFast()Description copied from class:ImmutableSetReturnstrueif thehashCode()method runs quickly.- Overrides:
isHashCodeFastin classImmutableSet<E>
-
toString
- Overrides:
toStringin classAbstractCollection<E>
-