public interface ArraySizingStrategy
int round(int capacity)
capacity
.int grow(int currentBufferLength, int elementsCount, int expectedAdditions)
currentBufferLength
- Current size of the array (buffer). This number
should comply with the strategy's policies (it is a result of initial rounding
or further growths). It can also be zero, indicating the growth from an empty
buffer.elementsCount
- Number of elements stored in the buffer.expectedAdditions
- Expected number of additions (resize hint).elementsCount + expectedAdditions
.Copyright © 2014 Carrot Search s.c.. All rights reserved.