private abstract static class ImmutableSet.SetBuilderImpl<E>
extends java.lang.Object
Modifier and Type | Field and Description |
---|---|
(package private) E[] |
dedupedElements |
(package private) int |
distinct |
Constructor and Description |
---|
SetBuilderImpl(ImmutableSet.SetBuilderImpl<E> toCopy)
Initializes this SetBuilderImpl with a copy of the deduped elements array from toCopy.
|
SetBuilderImpl(int expectedCapacity) |
Modifier and Type | Method and Description |
---|---|
(package private) abstract ImmutableSet.SetBuilderImpl<E> |
add(E e)
Adds e to this SetBuilderImpl, returning the updated result.
|
(package private) void |
addDedupedElement(E e)
Adds e to the insertion-order array of deduplicated elements.
|
(package private) abstract ImmutableSet<E> |
build() |
(package private) ImmutableSet.SetBuilderImpl<E> |
combine(ImmutableSet.SetBuilderImpl<E> other)
Adds all the elements from the specified SetBuilderImpl to this SetBuilderImpl.
|
(package private) abstract ImmutableSet.SetBuilderImpl<E> |
copy()
Creates a new copy of this SetBuilderImpl.
|
private void |
ensureCapacity(int minCapacity)
Resizes internal data structures if necessary to store the specified number of distinct
elements.
|
(package private) ImmutableSet.SetBuilderImpl<E> |
review()
Call this before build().
|
E[] dedupedElements
int distinct
SetBuilderImpl(int expectedCapacity)
SetBuilderImpl(ImmutableSet.SetBuilderImpl<E> toCopy)
private void ensureCapacity(int minCapacity)
final void addDedupedElement(E e)
abstract ImmutableSet.SetBuilderImpl<E> add(E e)
final ImmutableSet.SetBuilderImpl<E> combine(ImmutableSet.SetBuilderImpl<E> other)
abstract ImmutableSet.SetBuilderImpl<E> copy()
ImmutableSet.SetBuilderImpl<E> review()
abstract ImmutableSet<E> build()