final class RegularImmutableSet<E> extends ImmutableSet.CachingAsList<E>
ImmutableSet with two or more elements.ImmutableSet.Builder<E>, ImmutableSet.CachingAsList<E>, ImmutableSet.Indexed<E>| Modifier and Type | Field and Description |
|---|---|
private java.lang.Object[] |
elements |
(package private) static RegularImmutableSet<java.lang.Object> |
EMPTY |
private static java.lang.Object[] |
EMPTY_ARRAY |
private int |
hashCode |
private int |
mask |
(package private) java.lang.Object[] |
table |
MAX_TABLE_SIZE, SPLITERATOR_CHARACTERISTICS| Constructor and Description |
|---|
RegularImmutableSet(java.lang.Object[] elements,
int hashCode,
java.lang.Object[] table,
int mask) |
| Modifier and Type | Method and Description |
|---|---|
boolean |
contains(java.lang.Object target) |
(package private) int |
copyIntoArray(java.lang.Object[] dst,
int offset)
Copies the contents of this immutable collection into the specified array at the specified
offset.
|
(package private) ImmutableList<E> |
createAsList() |
int |
hashCode() |
(package private) java.lang.Object[] |
internalArray()
If this collection is backed by an array of its elements in insertion order, returns it.
|
(package private) int |
internalArrayEnd()
If this collection is backed by an array of its elements in insertion order, returns the offset
where this collection's elements end.
|
(package private) int |
internalArrayStart()
If this collection is backed by an array of its elements in insertion order, returns the offset
where this collection's elements start.
|
(package private) boolean |
isHashCodeFast()
Returns
true if the hashCode() method runs quickly. |
(package private) boolean |
isPartialView()
Returns
true if this immutable collection's implementation contains references to
user-created objects that aren't accessible via this collection's methods. |
UnmodifiableIterator<E> |
iterator()
Returns an unmodifiable iterator across the elements in this collection.
|
int |
size() |
java.util.Spliterator<E> |
spliterator() |
asListbuilder, builderWithExpectedSize, chooseTableSize, copyOf, copyOf, copyOf, copyOf, equals, of, of, of, of, of, of, of, toImmutableSet, writeReplaceadd, addAll, clear, remove, removeAll, removeIf, retainAll, toArray, toArrayclone, finalize, getClass, notify, notifyAll, wait, wait, waitprivate static final java.lang.Object[] EMPTY_ARRAY
static final RegularImmutableSet<java.lang.Object> EMPTY
private final transient java.lang.Object[] elements
private final transient int hashCode
final transient java.lang.Object[] table
private final transient int mask
RegularImmutableSet(java.lang.Object[] elements,
int hashCode,
java.lang.Object[] table,
int mask)
public boolean contains(@CheckForNull
java.lang.Object target)
contains in interface java.util.Collection<E>contains in interface java.util.Set<E>contains in class ImmutableCollection<E>public int size()
public UnmodifiableIterator<E> iterator()
ImmutableCollectionpublic java.util.Spliterator<E> spliterator()
spliterator in interface java.lang.Iterable<E>spliterator in interface java.util.Collection<E>spliterator in interface java.util.Set<E>spliterator in class ImmutableCollection<E>java.lang.Object[] internalArray()
ImmutableCollectioninternalArray in class ImmutableCollection<E>int internalArrayStart()
ImmutableCollectioninternalArrayStart in class ImmutableCollection<E>int internalArrayEnd()
ImmutableCollectioninternalArrayEnd in class ImmutableCollection<E>int copyIntoArray(java.lang.Object[] dst,
int offset)
ImmutableCollectionoffset + size().copyIntoArray in class ImmutableCollection<E>ImmutableList<E> createAsList()
createAsList in class ImmutableSet.CachingAsList<E>boolean isPartialView()
ImmutableCollectiontrue 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.isPartialView in class ImmutableCollection<E>public int hashCode()
hashCode in interface java.util.Collection<E>hashCode in interface java.util.Set<E>hashCode in class ImmutableSet<E>boolean isHashCodeFast()
ImmutableSettrue if the hashCode() method runs quickly.isHashCodeFast in class ImmutableSet<E>