Interface CapacityExtendable

    • Method Detail

      • ensureFreeCapacity

        CapacityExtendable ensureFreeCapacity​(long minimalFreeCapacity)
        Ensures that the next minimalFreeCapacity elements can be actually added in a fast way, meaning for example no internal storage rebuild will be necessary.
        Parameters:
        minimalFreeCapacity -
      • currentCapacity

        long currentCapacity()
        Returns the current amount of elements this instance can hold before a storage rebuild becomes necessary.

        For carrier implementations that don't have a concept of storage rebuilding (like linked list for example) this method returns the same value as CapacityCarrying.maximumCapacity().

        Returns:
        the current capacity of this instance before a rebuild is required.
      • currentFreeCapacity

        default long currentFreeCapacity()