public abstract class AbstractLRSProxyCollection extends java.lang.Object implements java.util.Set, LRSProxy, org.apache.commons.collections.Predicate, CollectionChangeTracker
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 and Description |
|---|
AbstractLRSProxyCollection(java.lang.Class elementType,
boolean ordered)
Constructor.
|
| Modifier and Type | Method and Description |
|---|---|
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() |
(package private) boolean |
isIterated()
used in testing; we need to be able to make sure that OpenJPA does not
iterate lrs fields during standard crud operations
|
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) |
(package private) void |
setIterated(boolean it)
used in testing; we need to be able to make sure that OpenJPA does not
iterate lrs fields during standard crud operations
|
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() |
public AbstractLRSProxyCollection(java.lang.Class elementType,
boolean ordered)
elementType - the allowed type of elements, or null for no
restrictionsordered - true if this collection is orderedpublic void setOwner(OpenJPAStateManager sm, int field)
Proxypublic OpenJPAStateManager getOwner()
Proxypublic int getOwnerField()
ProxygetOwnerField in interface Proxypublic ChangeTracker getChangeTracker()
ProxygetChangeTracker in interface Proxypublic java.lang.Object copy(java.lang.Object orig)
Proxypublic boolean add(java.lang.Object o)
add in interface java.util.Collectionadd in interface java.util.Setpublic boolean addAll(java.util.Collection all)
addAll in interface java.util.CollectionaddAll in interface java.util.Setpublic boolean remove(java.lang.Object o)
remove in interface java.util.Collectionremove in interface java.util.Setpublic boolean removeAll(java.util.Collection all)
removeAll in interface java.util.CollectionremoveAll in interface java.util.Setpublic boolean retainAll(java.util.Collection all)
retainAll in interface java.util.CollectionretainAll in interface java.util.Setpublic void clear()
clear in interface java.util.Collectionclear in interface java.util.Setpublic boolean contains(java.lang.Object o)
contains in interface java.util.Collectioncontains in interface java.util.Setpublic boolean containsAll(java.util.Collection all)
containsAll in interface java.util.CollectioncontainsAll in interface java.util.Setpublic java.lang.Object[] toArray()
toArray in interface java.util.CollectiontoArray in interface java.util.Setpublic java.lang.Object[] toArray(java.lang.Object[] a)
toArray in interface java.util.CollectiontoArray in interface java.util.Setpublic int size()
size in interface java.util.Collectionsize in interface java.util.Setpublic boolean isEmpty()
isEmpty in interface java.util.CollectionisEmpty in interface java.util.Setpublic java.util.Iterator iterator()
iterator in interface java.lang.Iterableiterator in interface java.util.Collectioniterator in interface java.util.Setboolean isIterated()
void setIterated(boolean it)
protected java.lang.Object writeReplace()
throws java.io.ObjectStreamException
java.io.ObjectStreamExceptionprotected 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.Predicatepublic boolean isTracking()
ChangeTrackerisTracking in interface ChangeTrackerpublic void startTracking()
ChangeTrackerstartTracking in interface ChangeTrackerpublic void stopTracking()
ChangeTrackerstopTracking in interface ChangeTrackerpublic java.util.Collection getAdded()
ChangeTrackergetAdded in interface ChangeTrackerpublic java.util.Collection getRemoved()
ChangeTrackergetRemoved in interface ChangeTrackerpublic java.util.Collection getChanged()
ChangeTrackergetChanged in interface ChangeTrackerpublic void added(java.lang.Object val)
CollectionChangeTrackeradded in interface CollectionChangeTrackerpublic void removed(java.lang.Object val)
CollectionChangeTrackerremoved in interface CollectionChangeTrackerpublic int getNextSequence()
ChangeTrackergetNextSequence in interface ChangeTrackerpublic void setNextSequence(int seq)
ChangeTrackersetNextSequence in interface ChangeTrackerCopyright © 2006-2013 Apache Software Foundation. All Rights Reserved.