All Downloads are FREE. Search and download functionalities are using the official Maven repository.

com.mayabot.nlp.common.ArraySizingStrategy Maven / Gradle / Ivy

package com.mayabot.nlp.common;

/**
 * Resizing (growth) strategy for array-backed buffers.
 */
public interface ArraySizingStrategy {
    /**
     * @param 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.
     * @param elementsCount       Number of elements stored in the buffer.
     * @param expectedAdditions   Expected number of additions (resize hint).
     * @return Must return a new size at least as big as to hold
     * elementsCount + expectedAdditions.
     */
    int grow(int currentBufferLength, int elementsCount, int expectedAdditions);
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy