Interface Preallocable

All Known Implementing Classes:
ByteArrayDeque, ByteArrayList, ByteStack, CharArrayDeque, CharArrayList, CharByteHashMap, CharCharHashMap, CharDoubleHashMap, CharFloatHashMap, CharHashSet, CharIntHashMap, CharLongHashMap, CharObjectHashMap, CharShortHashMap, CharStack, DoubleArrayDeque, DoubleArrayList, DoubleStack, FloatArrayDeque, FloatArrayList, FloatStack, IntArrayDeque, IntArrayList, IntByteHashMap, IntCharHashMap, IntDoubleHashMap, IntFloatHashMap, IntHashSet, IntIntHashMap, IntLongHashMap, IntObjectHashMap, IntShortHashMap, IntStack, LongArrayDeque, LongArrayList, LongByteHashMap, LongCharHashMap, LongDoubleHashMap, LongFloatHashMap, LongHashSet, LongIntHashMap, LongLongHashMap, LongObjectHashMap, LongShortHashMap, LongStack, ObjectArrayDeque, ObjectArrayList, ObjectByteHashMap, ObjectByteIdentityHashMap, ObjectCharHashMap, ObjectCharIdentityHashMap, ObjectDoubleHashMap, ObjectDoubleIdentityHashMap, ObjectFloatHashMap, ObjectFloatIdentityHashMap, ObjectHashSet, ObjectIdentityHashSet, ObjectIntHashMap, ObjectIntIdentityHashMap, ObjectLongHashMap, ObjectLongIdentityHashMap, ObjectObjectHashMap, ObjectObjectIdentityHashMap, ObjectShortHashMap, ObjectShortIdentityHashMap, ObjectStack, ShortArrayDeque, ShortArrayList, ShortByteHashMap, ShortCharHashMap, ShortDoubleHashMap, ShortFloatHashMap, ShortHashSet, ShortIntHashMap, ShortLongHashMap, ShortObjectHashMap, ShortShortHashMap, ShortStack

public interface Preallocable
Anything that can preallocate buffers given prior knowledge of the number of stored elements.
  • Method Summary

    Modifier and Type
    Method
    Description
    void
    ensureCapacity(int expectedElements)
    Ensure this container can hold at least the given number of elements without resizing its buffers.
  • Method Details

    • ensureCapacity

      void ensureCapacity(int expectedElements)
      Ensure this container can hold at least the given number of elements without resizing its buffers.
      Parameters:
      expectedElements - The total number of elements, inclusive.