Package org.apache.openjpa.util
Class CollectionChangeTrackerImpl
java.lang.Object
org.apache.openjpa.util.AbstractChangeTracker
org.apache.openjpa.util.CollectionChangeTrackerImpl
- All Implemented Interfaces:
ChangeTracker,CollectionChangeTracker
- Direct Known Subclasses:
DelayedCollectionChangeTrackerImpl
public class CollectionChangeTrackerImpl
extends AbstractChangeTracker
implements CollectionChangeTracker
Default
CollectionChangeTracker.- Author:
- Abe White
-
Field Summary
FieldsModifier and TypeFieldDescriptionprotected final Collectionprotected final booleanprotected final booleanFields inherited from class org.apache.openjpa.util.AbstractChangeTracker
add, change, rem -
Constructor Summary
ConstructorsConstructorDescriptionCollectionChangeTrackerImpl(Collection coll, boolean dups, boolean order, boolean autoOff) Constructor. -
Method Summary
Modifier and TypeMethodDescriptionprotected voidMark the given value as added.voidNotify the tracker that the given object was added.booleanWhether the underlying collection allows duplicates.protected voidMark the given value as changed.protected intReturn the initial sequence value for this proxy.booleanWhether the underlying collection is ordered.protected voidMark the given value as removed.voidNotify the tracker that the given object was removed.Methods inherited from class org.apache.openjpa.util.AbstractChangeTracker
changed, getAdded, getAutoOff, getChanged, getNextSequence, getRemoved, isTracking, newSet, reset, setAutoOff, setNextSequence, startTracking, stopTrackingMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface org.apache.openjpa.util.ChangeTracker
getAdded, getChanged, getNextSequence, getRemoved, isTracking, setNextSequence, startTracking, stopTracking
-
Field Details
-
_coll
-
_dups
protected final boolean _dups -
_order
protected final boolean _order
-
-
Constructor Details
-
CollectionChangeTrackerImpl
Constructor.- Parameters:
coll- the collection to delegate todups- true if the collection allows duplicates, false otherwiseorder- true if the collection is ordered, false otherwise
-
-
Method Details
-
allowsDuplicates
public boolean allowsDuplicates()Whether the underlying collection allows duplicates. -
isOrdered
public boolean isOrdered()Whether the underlying collection is ordered. -
added
Description copied from class:AbstractChangeTrackerNotify the tracker that the given object was added.- Specified by:
addedin interfaceCollectionChangeTracker- Overrides:
addedin classAbstractChangeTracker
-
removed
Description copied from class:AbstractChangeTrackerNotify the tracker that the given object was removed.- Specified by:
removedin interfaceCollectionChangeTracker- Overrides:
removedin classAbstractChangeTracker
-
initialSequence
protected int initialSequence()Description copied from class:AbstractChangeTrackerReturn the initial sequence value for this proxy. Typically this is the container size. Assumes an unordered collection by default, returning 0.- Overrides:
initialSequencein classAbstractChangeTracker
-
add
Description copied from class:AbstractChangeTrackerMark the given value as added.- Specified by:
addin classAbstractChangeTracker
-
remove
Description copied from class:AbstractChangeTrackerMark the given value as removed.- Specified by:
removein classAbstractChangeTracker
-
change
Description copied from class:AbstractChangeTrackerMark the given value as changed.- Specified by:
changein classAbstractChangeTracker
-