package com.srbenoit.sparsearray;

/**
 * An interface for objects that need to be notified when the internal structure of a sparse array
 * changes.
 */
public interface SparseArrayListener {

    /**
     * Called when the capacity of the sparse array is changed, to allow other programs that need
     * to keep arrays of the same size to adjust their arrays.
     *
     * @param  array        the array whose capacity is changing
     * @param  newCapacity  the new capacity of the sparse array
     */
    void capacityChanged(final SparseArray<?> array, int newCapacity);
}
