org.intermine.util
Class CacheHoldingArrayList

java.lang.Object
  extended by java.util.AbstractCollection<E>
      extended by java.util.AbstractList<E>
          extended by java.util.ArrayList
              extended by org.intermine.util.CacheHoldingArrayList
All Implemented Interfaces:
java.io.Serializable, java.lang.Cloneable, java.lang.Iterable, java.util.Collection, java.util.List, java.util.RandomAccess

public class CacheHoldingArrayList
extends java.util.ArrayList

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.

See Also:
Serialized Form

Field Summary
 
Fields inherited from class java.util.AbstractList
modCount
 
Constructor Summary
CacheHoldingArrayList()
          Empty constructor
CacheHoldingArrayList(java.util.Collection col)
          Constructs a new instance from another Collection.
CacheHoldingArrayList(int capacity)
          Constructs a new instance with the given initial capacity.
 
Method Summary
 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, get, indexOf, isEmpty, lastIndexOf, remove, remove, removeRange, set, size, toArray, toArray, trimToSize
 
Methods inherited from class java.util.AbstractList
equals, hashCode, iterator, listIterator, listIterator, subList
 
Methods inherited from class java.util.AbstractCollection
containsAll, removeAll, retainAll, toString
 
Methods inherited from class java.lang.Object
finalize, getClass, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface java.util.List
containsAll, equals, hashCode, iterator, listIterator, listIterator, removeAll, retainAll, subList
 

Constructor Detail

CacheHoldingArrayList

public CacheHoldingArrayList()
Empty constructor


CacheHoldingArrayList

public CacheHoldingArrayList(java.util.Collection 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
Method Detail

addToHolder

public void addToHolder(java.lang.Object o)
Adds an object to the holder. This prevents the given object from being garbage collected until this List is garbage-collected.

Parameters:
o - any Object