ArrayList uses:
minGrow = 1 maxGrow = Integer.MAX_VALUE (unbounded) growRatio = 1.5f
| Modifier and Type | Field and Description |
|---|---|
| public static final float | DEFAULT_GROW_RATIO
Default resize is by half the current buffer's size. |
| public static final BoundedProportionalArraySizingStrategy | DEFAULT_INSTANCE
Instance of |
| public static final int | DEFAULT_MAX_GROW_COUNT
Maximum grow count (unbounded). |
| public static final int | DEFAULT_MIN_GROW_COUNT
Minimum grow count. |
| public final float | growRatio
The current buffer length is multiplied by this ratio to get the first estimate for the new size. |
| public static final int | MAX_ARRAY_LENGTH
Maximum allocable array length (approximately the largest positive integer decreased by the array's object header). |
| public final int | maxGrowCount
Maximum number of elements to grow, if limit exceeded. |
| public final int | minGrowCount
Minimum number of elements to grow, if limit exceeded. |
| Access | Constructor and Description |
|---|---|
| public | |
| public | BoundedProportionalArraySizingStrategy(int
Minimum number of elements to grow by when expanding. minGrow, int Maximum number of elements to grow by when expanding. maxGrow, float The ratio of expansion compared to the previous buffer size. ratio)Create the sizing strategy with custom policies. |
| Modifier and Type | Method and Description |
|---|---|
| public int | Returns: New buffer size.The current length of the buffer. currentBufferLength, int The number of elements stored in the buffer. elementsCount, int The number of expected additions to the buffer. expectedAdditions)Implements com. Grow according to |
| public long | ramBytesAllocated()
Implements com. Allocated memory estimation |
| public long | ramBytesUsed()
Implements com. Bytes that is actually been used |
| DEFAULT_GROW_RATIO | back to summary |
|---|---|
| public static final float DEFAULT_GROW_RATIO Default resize is by half the current buffer's size. | |
| DEFAULT_INSTANCE | back to summary |
|---|---|
| public static final BoundedProportionalArraySizingStrategy DEFAULT_INSTANCE Instance of | |
| DEFAULT_MAX_GROW_COUNT | back to summary |
|---|---|
| public static final int DEFAULT_MAX_GROW_COUNT Maximum grow count (unbounded). | |
| DEFAULT_MIN_GROW_COUNT | back to summary |
|---|---|
| public static final int DEFAULT_MIN_GROW_COUNT Minimum grow count. | |
| growRatio | back to summary |
|---|---|
| public final float growRatio The current buffer length is multiplied by this ratio to get the first estimate for the new
size. To double the size of the current buffer, for example, set to | |
| MAX_ARRAY_LENGTH | back to summary |
|---|---|
| public static final int MAX_ARRAY_LENGTH Maximum allocable array length (approximately the largest positive integer decreased by the array's object header). | |
| maxGrowCount | back to summary |
|---|---|
| public final int maxGrowCount Maximum number of elements to grow, if limit exceeded. | |
| minGrowCount | back to summary |
|---|---|
| public final int minGrowCount Minimum number of elements to grow, if limit exceeded. | |
| BoundedProportionalArraySizingStrategy | back to summary |
|---|---|
| public BoundedProportionalArraySizingStrategy() Create the default sizing strategy. | |
| BoundedProportionalArraySizingStrategy | back to summary |
|---|---|
| public BoundedProportionalArraySizingStrategy(int minGrow, int maxGrow, float ratio) Create the sizing strategy with custom policies.
| |
| grow | back to summary |
|---|---|
| public int grow(int currentBufferLength, int elementsCount, int expectedAdditions) Implements com. Grow according to
| |
| ramBytesAllocated | back to summary |
|---|---|
| public long ramBytesAllocated() Implements com. Doc from com. Allocated memory estimation
| |
| ramBytesUsed | back to summary |
|---|---|
| public long ramBytesUsed() Implements com. Doc from com. Bytes that is actually been used
| |