public class CachedArrayList extends ArrayList(Code)
This is a fast access ArrayList that sacrifices memory for speed. It will
reduce the speed of indexOf method from O(n) to O(1). However it will at least double
the memory used by ArrayList. So use it approriately.
adjustCache(int index, int increase) Adjusts the cache so that all values that are greater than index will increase by the value specified by the increase parameter.
Parameters: index - the index.
public boolean addAll(int index, Collection<? extends E> c)(Code)
adjustCache
protected void adjustCache(int index, int increase)(Code)
Adjusts the cache so that all values that are greater than index will increase by the value specified by the increase parameter.
Parameters: index - the index. All values above this index will be changed. Parameters: increase - a positive number to increase or a negative number to decrease.