SolarMetric Kodo JDO 2.5.8 generated on January 11 2004

com.solarmetric.kodo.runtime.datacache.query
Class CachingRandomAccessList

java.lang.Object
  |
  +--java.util.AbstractCollection
        |
        +--java.util.AbstractList
              |
              +--com.solarmetric.kodo.runtime.datacache.query.CachingRandomAccessList
All Implemented Interfaces:
CachingList, ClassChangeListener, Collection, List, ResultList, Serializable

public class CachingRandomAccessList
extends AbstractList
implements CachingList, ClassChangeListener, Serializable

A wrapper around a ResultList that builds up a list of all the OIDs in this list and registers that list with the query cache.

Abandons monitoring and registering if one of the classes in #getAccessPathClasses is modified while the query results are being loaded, or if #getAccessPathClasses is null.

Since:
2.5
See Also:
Serialized Form

Fields inherited from class java.util.AbstractList
modCount
 
Constructor Summary
protected CachingRandomAccessList(ResultList wrapee, QueryKey key, DataCacheStoreManager store)
           
 
Method Summary
 void abortCaching()
          Instructs this list to stop caching results returned from this list.
 void checkClosed()
          Check to see if this ResultList has been closed, and if so, throw a JDOUserException.
 void classesChanged(Set changed)
          Invoked when objects of the types in the classes set have been changed.
 void close()
          Close the list.
 boolean equals(Object other)
          Unless the list is completely instantiated, returns the identity equals for objects, since returning the default Collection.equals(java.lang.Object) behanvior would mean that we have to traverse the entire list.
 Object get(int arg)
           
 int getInstantiatedCount()
          Returns the number of objects that are currently instantiated internally in this list.
 int hashCode()
          Unless the list is completely instantiated, returns the identity hash code of this object, since returning the default Collection.hashCode() behanvior would mean that we have to traverse the entire list.
 boolean isCaching()
          Returns true if this list is currently caching results retrieved from the list; otherwise returns false.
 boolean isClosed()
          Returns true if the list has been closed.
 int size()
           
 Object writeReplace()
           
 
Methods inherited from class java.util.AbstractList
add, add, addAll, clear, indexOf, iterator, lastIndexOf, listIterator, listIterator, remove, removeRange, set, subList
 
Methods inherited from class java.util.AbstractCollection
addAll, contains, containsAll, isEmpty, remove, removeAll, retainAll, toArray, toArray, toString
 
Methods inherited from class java.lang.Object
, clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface java.util.List
add, add, addAll, addAll, clear, contains, containsAll, indexOf, isEmpty, iterator, lastIndexOf, listIterator, listIterator, remove, remove, removeAll, retainAll, set, subList, toArray, toArray
 

Constructor Detail

CachingRandomAccessList

protected CachingRandomAccessList(ResultList wrapee,
                                  QueryKey key,
                                  DataCacheStoreManager store)
Method Detail

isCaching

public boolean isCaching()
Description copied from interface: CachingList
Returns true if this list is currently caching results retrieved from the list; otherwise returns false.
Specified by:
isCaching in interface CachingList

abortCaching

public void abortCaching()
Description copied from interface: CachingList
Instructs this list to stop caching results returned from this list. Upon invoking this method, all caching efforts are aborted, and any partial results are dropped.
Specified by:
abortCaching in interface CachingList

get

public Object get(int arg)
Specified by:
get in interface List
Overrides:
get in class AbstractList

size

public int size()
Specified by:
size in interface List
Overrides:
size in class AbstractCollection

hashCode

public int hashCode()

Unless the list is completely instantiated, returns the identity hash code of this object, since returning the default Collection.hashCode() behanvior would mean that we have to traverse the entire list.

If the list is completely instantiated, the standard Collection.hashCode() contract is respected.

Specified by:
hashCode in interface List
Overrides:
hashCode in class AbstractList

equals

public boolean equals(Object other)

Unless the list is completely instantiated, returns the identity equals for objects, since returning the default Collection.equals(java.lang.Object) behanvior would mean that we have to traverse the entire list.

If the list is completely instantiated, the standard Collection.equals(java.lang.Object) contract is respected.

Specified by:
equals in interface List
Overrides:
equals in class AbstractList

classesChanged

public void classesChanged(Set changed)
Description copied from interface: ClassChangeListener

Invoked when objects of the types in the classes set have been changed. This could mean that items have been updated, deleted, or added.

Specified by:
classesChanged in interface ClassChangeListener
Following copied from interface: com.solarmetric.kodo.runtime.datacache.query.ClassChangeListener
Parameters:
classes - a Set of Class objects that correspond to instances that have changed

close

public void close()
           throws JDOException
Description copied from interface: ResultList
Close the list.
Specified by:
close in interface ResultList

isClosed

public boolean isClosed()
                 throws JDOException
Description copied from interface: ResultList
Returns true if the list has been closed.
Specified by:
isClosed in interface ResultList

checkClosed

public void checkClosed()
                 throws JDOException
Description copied from interface: ResultList
Check to see if this ResultList has been closed, and if so, throw a JDOUserException.
Specified by:
checkClosed in interface ResultList

getInstantiatedCount

public int getInstantiatedCount()
Description copied from interface: ResultList
Returns the number of objects that are currently instantiated internally in this list.
Specified by:
getInstantiatedCount in interface ResultList

writeReplace

public Object writeReplace()
                    throws ObjectStreamException

SolarMetric Kodo JDO 2.5.8 generated on January 11 2004

Copyright 2001,2002,2003 SolarMetric, Inc. All Rights Reserved.