<commit_before>package org.jlib.container.sequence.index.array.storage;

/**
 * Provider of capacity in a {@link LinearIndexStorage}.
 * 
 * @author <NAME>
 */
public interface LinearIndexStorageCapacityStrategy {

    /**
     * Asserts that the referenced {@link LinearIndexStorage} fits the specified
     * number of Items, leaving a hole of the specified size between the
     * existing Items. If necessary, the Items located behind the hole index are
     * moved behind the hole.
     * 
     * @param itemsCount
     *        integer specifying the number of Items
     * 
     * @param holeIndex
     *        integer specifying the hole index
     * 
     * @param holeSize
     *        integer specifying the size of the hole
     * 
     * @throws LinearIndexStorageException
     *         if {@code itemsCount < 1 ||
     *                   holeIndex < linearIndexStorage.getFirstIndex() || holeIndex > linearIndexStorage.getLastIndex() || 
     *                   holeSize < 0 ||
     *                   holeSize + linearIndexStorage.getItemsCount() > itemsCount}
     */
    public void assertCapacityWithMiddleHole(final int itemsCount, final int holeIndex, final int holeSize)
    throws LinearIndexStorageException;

    /**
     * Asserts that the referenced {@link LinearIndexStorage} fits the specified
     * number of Items, leaving a hole of the specified size in front of the
     * existing Items. The first index of the {@link LinearIndexStorage} is
     * decremented by the hole size. The indices of all existing Items are left
     * unchanged.
     * 
     * @param itemsCount
     *        integer specifying the number of Items
     * 
     * @param holeSize
     *        integer specifying the size of the hole
     * 
     * @throws LinearIndexStorageException
     *         if {@code itemsCount < 1 || 
     *                   holeSize < 0 ||
     *                   holeSize + linearIndexStorage.getItemsCount() < itemsCount}
     */
    public void assertCapacityWithHeadHole(final int itemsCount, final int holeSize)
    throws LinearIndexStorageException;

    /**
     * Asserts that the referenced {@link LinearIndexStorage} fits the specified
     * number of Items, leaving a hole of the specified size behind the existing
     * Items. The last index of the {@link LinearIndexStorage} is incremented by
     * the hole size. The indices of all existing Items are left unchanged.
     * 
     * @param itemsCount
     *        integer specifying the number of Items
     * 
     * @param holeSize
     *        integer specifying the size of the hole
     * 
     * @throws LinearIndexStorageException
     *         if {@code itemsCount < 1 || 
     *                   holeSize < 0 ||
     *                   linearIndexStorage.getItemsCount() + holeSize < itemsCount}
     */
    public void assertCapacityWithTailHole(final int itemsCount, final int holeSize)
    throws LinearIndexStorageException;
}
<commit_msg>LinearIndexStorageCapacityStrategy: assert methods with capacity and holeSize created<commit_after>package org.jlib.container.sequence.index.array.storage;

/**
 * Strategy of capacity provision in a {@link LinearIndexStorage}.
 * 
 * @author <NAME>
 */
public interface LinearIndexStorageCapacityStrategy {

    /**
     * Asserts that the referenced {@link LinearIndexStorage} fits the specified
     * number of Items, leaving a hole of the specified size in front of the
     * existing Items. The first index of the {@link LinearIndexStorage} is
     * decremented by the hole size. The indices of all existing Items are left
     * unchanged.
     * 
     * @param capacity
     *        integer specifying the capacity
     * 
     * @param holeSize
     *        integer specifying the size of the hole
     * 
     * @throws LinearIndexStorageException
     *         if {@code capacity < 1 || 
     *                   holeSize < 0 ||
     *                   holeSize + linearIndexStorage.getItemsCount() > capacity}
     */
    public void assertCapacityWithHeadHole(final int capacity, final int holeSize)
    throws LinearIndexStorageException;

    /**
     * Asserts that the referenced {@link LinearIndexStorage} fits the specified
     * number of Items, leaving a hole of the specified size between the
     * existing Items. If necessary, the Items located behind the hole index are
     * moved behind the hole.
     * 
     * @param capacity
     *        integer specifying the capacity
     * 
     * @param holeIndex
     *        integer specifying the hole index
     * 
     * @param holeSize
     *        integer specifying the size of the hole
     * 
     * @throws LinearIndexStorageException
     *         if {@code capacity < 1 ||
     *                   holeIndex < linearIndexStorage.getFirstIndex() || holeIndex > linearIndexStorage.getLastIndex() || 
     *                   holeSize < 0 ||
     *                   linearIndexStorage.getLastItemIndex() + 1 + holeSize > capacity}
     */
    public void assertCapacityWithMiddleHole(final int capacity, final int holeIndex, final int holeSize)
    throws LinearIndexStorageException;

    /**
     * Asserts that the referenced {@link LinearIndexStorage} fits the specified
     * number of Items, leaving a hole of the specified size behind the existing
     * Items. The last index of the {@link LinearIndexStorage} is incremented by
     * the hole size. The indices of all existing Items are left unchanged.
     * 
     * @param capacity
     *        integer specifying the capacity
     * 
     * @param holeSize
     *        integer specifying the size of the hole
     * 
     * @throws LinearIndexStorageException
     *         if {@code capacity < 1 || 
     *                   holeSize < 0 ||
     *                   linearIndexStorage.getLastItemIndex() + 1 + holeSize > capacity}
     */
    public void assertCapacityWithTailHole(final int capacity, final int holeSize)
    throws LinearIndexStorageException;
}

{'fraction_non_alphanumeric': 0.06427990235964198, 'fraction_numerical': 0.002278275020341741, 'mean_word_length': 2.1245551601423487, 'pattern_counts': {'":': 0, '<': 21, '<?xml version=': 0, '>': 11, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '6278484', 'n_tokens_mistral': 1624, 'n_tokens_neox': 1445, 'n_words': 546}