One or more arrays are used to store elements. The use of a multiple
arrays has better performance characteristics than a single array used by
ArrayList, as when the capacity of the list needs to be increased
no copying of elements is required. This is usually beneficial in the case
where the results will be traversed a small number of times.
| Modifier and Type | Class and Description |
|---|---|
| pack-priv static class | SpinedBuffer.
An ordered collection of |
| pack-priv static class | SpinedBuffer.
An ordered collection of |
| pack-priv static class | SpinedBuffer.
An ordered collection of |
| pack-priv abstract static class | SpinedBuffer.
the wrapper type for this primitive type E, the array type for this primitive type T_ARR, the Consumer type for this primitive type T_CONS>An ordered collection of primitive values. |
| Modifier and Type | Field and Description |
|---|---|
| protected E[] | curChunk
Chunk that we're currently writing into; may or may not be aliased with the first element of the spine. |
| protected E[][] | spine
All chunks, or null if there is only one chunk. |
| private static final int |
| Access | Constructor and Description |
|---|---|
| pack-priv | SpinedBuffer(int
the initial capacity of the list initialCapacity)Constructs an empty list with the specified initial capacity. |
| pack-priv |
| Modifier and Type | Method and Description |
|---|---|
| public void | accept(E e)
Implements java. Performs this operation on the given argument. |
| public E[] | asArray(IntFunction<E[]> arrayFactory)
Create a new array using the specified array factory, and copy the elements into it. |
| protected long | |
| public void | clear()
Implements abstract java. Remove all data from the buffer |
| public void | copyInto(E[] array, int offset)
Copy the elements, starting at the specified offset, into the specified array. |
| protected final void | |
| public void | forEach(Consumer<? super E> consumer)
Overrides default java. Performs the given action for each element of the |
| public E | |
| protected void | |
| private void | |
| public Iterator | |
| public Spliterator | spliterator()
Overrides default java. Return a |
| public String |