|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object org.apache.openjpa.util.AbstractLRSProxyCollection
public abstract class AbstractLRSProxyCollection
A collection proxy designed for collections backed by extremely large
result sets in which each call to iterator()
may perform a database
query. Changes to the collection are tracked through a
ChangeTracker
. This collection has the following limitations:
size
method may return Integer.MAX_VALUE
.
Constructor Summary | |
---|---|
AbstractLRSProxyCollection(java.lang.Class elementType,
boolean ordered,
OpenJPAConfiguration conf)
Constructor. |
Method Summary | |
---|---|
boolean |
add(java.lang.Object o)
|
boolean |
addAll(java.util.Collection all)
|
void |
added(java.lang.Object val)
Record that the given element was added. |
void |
clear()
|
boolean |
contains(java.lang.Object o)
|
boolean |
containsAll(java.util.Collection all)
|
java.lang.Object |
copy(java.lang.Object orig)
Return an unproxied copy of the given instance. |
protected abstract int |
count()
Return the number of elements in the collection, or Integer.MAX_VALUE . |
boolean |
evaluate(java.lang.Object o)
|
java.util.Collection |
getAdded()
Return the collection of values that need to be added to the managed container. |
java.util.Collection |
getChanged()
Return the set of elements that have changed. |
ChangeTracker |
getChangeTracker()
Return the change tracker for this proxy, or null if none. |
int |
getNextSequence()
The next element sequence value for this proxy at load time. |
OpenJPAStateManager |
getOwner()
Return the owning object. |
int |
getOwnerField()
Return the owning field index. |
java.util.Collection |
getRemoved()
Return the set of values that need to be removed from the managed container. |
protected abstract boolean |
has(java.lang.Object o)
Return whether the collection contains the given element. |
boolean |
isEmpty()
|
boolean |
isTracking()
Return true if this tracker has an up-to-date view of all the changes to the container it is managing. |
java.util.Iterator |
iterator()
|
protected abstract java.util.Iterator |
itr()
Implement this method to return an iterator over the contents of the collection. |
boolean |
remove(java.lang.Object o)
|
boolean |
removeAll(java.util.Collection all)
|
void |
removed(java.lang.Object val)
Record that the given element was removed. |
boolean |
retainAll(java.util.Collection all)
|
void |
setNextSequence(int seq)
The maximum element sequence value for this proxy at load time. |
void |
setOwner(OpenJPAStateManager sm,
int field)
Reset the state of the proxy, and set the owning instance of the proxy and the name of the field it is assigned to. |
int |
size()
|
void |
startTracking()
Reset the state of the change tracker, and turn change tracking back on if it has been disabled. |
void |
stopTracking()
Tell the tracker to stop tracking changes for its container. |
java.lang.Object[] |
toArray()
|
java.lang.Object[] |
toArray(java.lang.Object[] a)
|
protected java.lang.Object |
writeReplace()
|
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Methods inherited from interface java.util.Set |
---|
equals, hashCode |
Constructor Detail |
---|
public AbstractLRSProxyCollection(java.lang.Class elementType, boolean ordered, OpenJPAConfiguration conf)
elementType
- the allowed type of elements, or null for no
restrictionsordered
- true if this collection is orderedMethod Detail |
---|
public void setOwner(OpenJPAStateManager sm, int field)
Proxy
setOwner
in interface Proxy
public OpenJPAStateManager getOwner()
Proxy
getOwner
in interface Proxy
public int getOwnerField()
Proxy
getOwnerField
in interface Proxy
public ChangeTracker getChangeTracker()
Proxy
getChangeTracker
in interface Proxy
public java.lang.Object copy(java.lang.Object orig)
Proxy
copy
in interface Proxy
public boolean add(java.lang.Object o)
add
in interface java.util.Collection
add
in interface java.util.Set
public boolean addAll(java.util.Collection all)
addAll
in interface java.util.Collection
addAll
in interface java.util.Set
public boolean remove(java.lang.Object o)
remove
in interface java.util.Collection
remove
in interface java.util.Set
public boolean removeAll(java.util.Collection all)
removeAll
in interface java.util.Collection
removeAll
in interface java.util.Set
public boolean retainAll(java.util.Collection all)
retainAll
in interface java.util.Collection
retainAll
in interface java.util.Set
public void clear()
clear
in interface java.util.Collection
clear
in interface java.util.Set
public boolean contains(java.lang.Object o)
contains
in interface java.util.Collection
contains
in interface java.util.Set
public boolean containsAll(java.util.Collection all)
containsAll
in interface java.util.Collection
containsAll
in interface java.util.Set
public java.lang.Object[] toArray()
toArray
in interface java.util.Collection
toArray
in interface java.util.Set
public java.lang.Object[] toArray(java.lang.Object[] a)
toArray
in interface java.util.Collection
toArray
in interface java.util.Set
public int size()
size
in interface java.util.Collection
size
in interface java.util.Set
public boolean isEmpty()
isEmpty
in interface java.util.Collection
isEmpty
in interface java.util.Set
public java.util.Iterator iterator()
iterator
in interface java.lang.Iterable
iterator
in interface java.util.Collection
iterator
in interface java.util.Set
protected java.lang.Object writeReplace() throws java.io.ObjectStreamException
java.io.ObjectStreamException
protected abstract java.util.Iterator itr()
Iterator.remove()
method,
and may implement Closeable
.
protected abstract boolean has(java.lang.Object o)
protected abstract int count()
Integer.MAX_VALUE
.
public boolean evaluate(java.lang.Object o)
evaluate
in interface org.apache.commons.collections.Predicate
public boolean isTracking()
ChangeTracker
isTracking
in interface ChangeTracker
public void startTracking()
ChangeTracker
startTracking
in interface ChangeTracker
public void stopTracking()
ChangeTracker
stopTracking
in interface ChangeTracker
public java.util.Collection getAdded()
ChangeTracker
getAdded
in interface ChangeTracker
public java.util.Collection getRemoved()
ChangeTracker
getRemoved
in interface ChangeTracker
public java.util.Collection getChanged()
ChangeTracker
getChanged
in interface ChangeTracker
public void added(java.lang.Object val)
CollectionChangeTracker
added
in interface CollectionChangeTracker
public void removed(java.lang.Object val)
CollectionChangeTracker
removed
in interface CollectionChangeTracker
public int getNextSequence()
ChangeTracker
getNextSequence
in interface ChangeTracker
public void setNextSequence(int seq)
ChangeTracker
setNextSequence
in interface ChangeTracker
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |