This class is similar to EntryAccumulatorArray, but is more suitable for use when the user expects varying, but large number of elements to be accumulated.
This class doesn't allocate the whole array for the given capacity, but does it progressively as more entries are added to it. The class divides the capacity into same sized partitions, and will allocate each partition when necessary.
This class should be used when possibly both large and small number of entries may be accumulated.
This accumulator can not be used concurrently from multiple threads.
Use one of the static create(
public void | Adds an element to the accumulator. |
public static < | create( Creates a new entry accumulator that is capable of holding at most the specified capacity number of entries. |
public static < | create( Creates a new entry accumulator for the given maximum capacity and partition size. |
public Iterator< | iterator() Returns an iterator over elements of type T . |
public void | put( Adds an key-value entry pair to the accumulator. |
public int | size() Gets the current number of accumulated elements in this accumulator. |
This is the same as create(
The returned accumulator is capable of holding at most the specified capacity number of entries.