@GwtCompatible(serializable=true, emulated=true) final class RegularImmutableSet<E> extends ImmutableSet.Indexed<E>
ImmutableSet
with two or more elements.ImmutableSet.Builder<E>, ImmutableSet.Indexed<E>
ImmutableCollection.ArrayBasedBuilder<E>
Modifier and Type | Field and Description |
---|---|
private java.lang.Object[] |
elements |
(package private) static RegularImmutableSet<java.lang.Object> |
EMPTY |
private int |
hashCode |
private int |
mask |
(package private) java.lang.Object[] |
table |
MAX_TABLE_SIZE
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() |
(package private) E |
get(int i) |
int |
hashCode() |
(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. |
int |
size() |
iterator
asList, builder, chooseTableSize, copyOf, copyOf, copyOf, copyOf, equals, of, of, of, of, of, of, of, writeReplace
add, addAll, clear, remove, removeAll, retainAll, toArray, toArray
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
static final RegularImmutableSet<java.lang.Object> EMPTY
private final transient java.lang.Object[] elements
final transient java.lang.Object[] table
private final transient int mask
private final transient int hashCode
RegularImmutableSet(java.lang.Object[] elements, int hashCode, java.lang.Object[] table, int mask)
public boolean contains(@Nullable 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()
E get(int i)
get
in class ImmutableSet.Indexed<E>
int copyIntoArray(java.lang.Object[] dst, int offset)
ImmutableCollection
offset + size()
.copyIntoArray
in class ImmutableCollection<E>
ImmutableList<E> createAsList()
createAsList
in class ImmutableSet.Indexed<E>
boolean isPartialView()
ImmutableCollection
true
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()
ImmutableSet
true
if the hashCode()
method runs quickly.isHashCodeFast
in class ImmutableSet<E>