org.apache.openjpa.lib.rop
Class RandomAccessResultList

java.lang.Object
  extended by org.apache.openjpa.lib.rop.AbstractResultList
      extended by org.apache.openjpa.lib.rop.AbstractNonSequentialResultList
          extended by org.apache.openjpa.lib.rop.RandomAccessResultList
All Implemented Interfaces:
Serializable, Iterable, Collection, List, ResultList, Closeable
Direct Known Subclasses:
SoftRandomAccessResultList

public class RandomAccessResultList
extends AbstractNonSequentialResultList

Random-access result list implementation. It maintains a map of the items that we have already instantiated.

Author:
Marc Prud'hommeaux, Abe White
See Also:
Serialized Form

Field Summary
 
Fields inherited from class org.apache.openjpa.lib.rop.AbstractNonSequentialResultList
PAST_END
 
Constructor Summary
RandomAccessResultList(ResultObjectProvider rop)
           
 
Method Summary
 void close()
          Close the list.
 boolean equals(Object other)
           
protected  Object getInternal(int index)
          Implement this method and List.size().
 int hashCode()
           
 boolean isClosed()
          Returns true if the list has been closed.
 boolean isProviderOpen()
          Returns true if the provider backing this list is open.
protected  Map newRowMap()
          Override this method to control what kind of map is used for the instantiated rows.
 int size()
           
 String toString()
           
 Object writeReplace()
           
 
Methods inherited from class org.apache.openjpa.lib.rop.AbstractNonSequentialResultList
contains, containsAll, get, indexOf, isEmpty, iterator, lastIndexOf, listIterator, listIterator, toArray, toArray
 
Methods inherited from class org.apache.openjpa.lib.rop.AbstractResultList
add, add, addAll, addAll, assertOpen, clear, finalize, remove, remove, removeAll, retainAll, set, subList
 
Methods inherited from class java.lang.Object
clone, getClass, notify, notifyAll, wait, wait, wait
 

Constructor Detail

RandomAccessResultList

public RandomAccessResultList(ResultObjectProvider rop)
Method Detail

newRowMap

protected Map newRowMap()
Override this method to control what kind of map is used for the instantiated rows.


isProviderOpen

public boolean isProviderOpen()
Description copied from interface: ResultList
Returns true if the provider backing this list is open.


isClosed

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


close

public void close()
Description copied from interface: ResultList
Close the list.


getInternal

protected Object getInternal(int index)
Description copied from class: AbstractNonSequentialResultList
Implement this method and List.size(). Return AbstractNonSequentialResultList.PAST_END if the index is out of bounds.

Specified by:
getInternal in class AbstractNonSequentialResultList

size

public int size()

writeReplace

public Object writeReplace()
                    throws ObjectStreamException
Throws:
ObjectStreamException

toString

public String toString()
Overrides:
toString in class Object

hashCode

public int hashCode()
Specified by:
hashCode in interface Collection
Specified by:
hashCode in interface List
Overrides:
hashCode in class Object

equals

public boolean equals(Object other)
Specified by:
equals in interface Collection
Specified by:
equals in interface List
Overrides:
equals in class Object


Copyright © 2006 Apache Software Foundation. All Rights Reserved.