Package org.apache.openjpa.lib.rop
Class RandomAccessResultList
- java.lang.Object
-
- org.apache.openjpa.lib.rop.AbstractResultList
-
- org.apache.openjpa.lib.rop.AbstractNonSequentialResultList
-
- org.apache.openjpa.lib.rop.RandomAccessResultList
-
- All Implemented Interfaces:
java.io.Serializable
,java.lang.Iterable
,java.util.Collection
,java.util.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
Constructors Constructor Description RandomAccessResultList(ResultObjectProvider rop)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
close()
Close the list.boolean
equals(java.lang.Object other)
protected java.lang.Object
getInternal(int index)
Implement this method andList.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 java.util.Map
newRowMap()
Override this method to control what kind of map is used for the instantiated rows.int
size()
java.lang.String
toString()
java.lang.Object
writeReplace()
-
Methods inherited from class org.apache.openjpa.lib.rop.AbstractNonSequentialResultList
contains, containsAll, get, indexOf, isEmpty, iterator, lastIndexOf, listIterator, listIterator, subList, toArray, toArray
-
Methods inherited from class org.apache.openjpa.lib.rop.AbstractResultList
add, add, addAll, addAll, assertOpen, clear, getUserObject, remove, remove, removeAll, retainAll, set, setUserObject
-
-
-
-
Constructor Detail
-
RandomAccessResultList
public RandomAccessResultList(ResultObjectProvider rop)
-
-
Method Detail
-
newRowMap
protected java.util.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 java.lang.Object getInternal(int index)
Description copied from class:AbstractNonSequentialResultList
Implement this method andList.size()
. ReturnAbstractNonSequentialResultList.PAST_END
if the index is out of bounds.- Specified by:
getInternal
in classAbstractNonSequentialResultList
-
size
public int size()
-
writeReplace
public java.lang.Object writeReplace() throws java.io.ObjectStreamException
- Throws:
java.io.ObjectStreamException
-
toString
public java.lang.String toString()
- Overrides:
toString
in classjava.lang.Object
-
hashCode
public int hashCode()
- Specified by:
hashCode
in interfacejava.util.Collection
- Specified by:
hashCode
in interfacejava.util.List
- Overrides:
hashCode
in classjava.lang.Object
-
equals
public boolean equals(java.lang.Object other)
- Specified by:
equals
in interfacejava.util.Collection
- Specified by:
equals
in interfacejava.util.List
- Overrides:
equals
in classjava.lang.Object
-
-