Top Description Methods
com.carrotsearch.hppc

public Interface ArraySizingStrategy

extends Accountable
Known Direct Implementers
com.carrotsearch.hppc.BoundedProportionalArraySizingStrategy

Resizing (growth) strategy for array-backed buffers.

Method Summary

Modifier and TypeMethod and Description
public int

Returns:

Must return a new size at least as big as to hold elementsCount + expectedAdditions.
grow
(int
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.
currentBufferLength
,
int
Number of elements stored in the buffer.
elementsCount
,
int
Expected number of additions (resize hint).
expectedAdditions
)

Inherited from com.carrotsearch.hppc.Accountable:
ramBytesAllocatedramBytesUsed

Method Detail

growback to summary
public int grow(int currentBufferLength, int elementsCount, int expectedAdditions) throws BufferAllocationException
Parameters
currentBufferLength:int

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:int

Number of elements stored in the buffer.

expectedAdditions:int

Expected number of additions (resize hint).

Returns:int

Must return a new size at least as big as to hold elementsCount + expectedAdditions.

Exceptions
BufferAllocationException:
If the sizing strategy cannot grow the buffer (for example due to constraints or memory limits).