- All Superinterfaces:
Accountable
- All Known Implementing Classes:
BoundedProportionalArraySizingStrategy
Resizing (growth) strategy for array-backed buffers.
-
Method Summary
Modifier and TypeMethodDescriptionintgrow(int currentBufferLength, int elementsCount, int expectedAdditions) Methods inherited from interface com.carrotsearch.hppc.Accountable
ramBytesAllocated, ramBytesUsed
-
Method Details
-
grow
int grow(int currentBufferLength, int elementsCount, int expectedAdditions) throws BufferAllocationException - Parameters:
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 growCalls). 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).- Returns:
- Must return a new size at least as big as to hold
elementsCount + expectedAdditions. - Throws:
BufferAllocationException- If the sizing strategy cannot grow the buffer (for example due to constraints or memory limits).
-