Package org.intermine.util
Class CacheHoldingArrayList<E>
- java.lang.Object
-
- java.util.AbstractCollection<E>
-
- java.util.AbstractList<E>
-
- java.util.ArrayList<E>
-
- org.intermine.util.CacheHoldingArrayList<E>
-
- Type Parameters:
E
- The element type
- All Implemented Interfaces:
java.io.Serializable
,java.lang.Cloneable
,java.lang.Iterable<E>
,java.util.Collection<E>
,java.util.List<E>
,java.util.RandomAccess
public class CacheHoldingArrayList<E> extends java.util.ArrayList<E>
This is an extension of the the ArrayList class, designed to be used by systems that return Lists of data, with extra data that should not be flushed out of a cache until the List is garbage collected. This is used for example in the ObjectStoreItemPathFollowingImpl, when it generates a batch. The objectstore fetches additional useful objects, and stores them in the holder of a CacheHoldingArrayList as well as a cache. The holder them prevents the extra useful objects from being flushed out of the cache until the DataTranslator has finished with the batch.- Author:
- Matthew Wakeling
- See Also:
- Serialized Form
-
-
Constructor Summary
Constructors Constructor Description CacheHoldingArrayList()
Empty constructorCacheHoldingArrayList(int capacity)
Constructs a new instance with the given initial capacity.CacheHoldingArrayList(java.util.Collection<E> col)
Constructs a new instance from another Collection.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
addToHolder(java.lang.Object o)
Adds an object to the holder.-
Methods inherited from class java.util.ArrayList
add, add, addAll, addAll, clear, clone, contains, ensureCapacity, equals, forEach, get, hashCode, indexOf, isEmpty, iterator, lastIndexOf, listIterator, listIterator, remove, remove, removeAll, removeIf, removeRange, replaceAll, retainAll, set, size, sort, spliterator, subList, toArray, toArray, trimToSize
-
-
-
-
Constructor Detail
-
CacheHoldingArrayList
public CacheHoldingArrayList()
Empty constructor
-
CacheHoldingArrayList
public CacheHoldingArrayList(java.util.Collection<E> col)
Constructs a new instance from another Collection.- Parameters:
col
- a Collection
-
CacheHoldingArrayList
public CacheHoldingArrayList(int capacity)
Constructs a new instance with the given initial capacity.- Parameters:
capacity
- the initial capacity
-
-