org.apache.openjpa.util
Class CollectionChangeTrackerImpl

java.lang.Object
  extended by org.apache.openjpa.util.AbstractChangeTracker
      extended by org.apache.openjpa.util.CollectionChangeTrackerImpl
All Implemented Interfaces:
ChangeTracker, CollectionChangeTracker

public class CollectionChangeTrackerImpl
extends AbstractChangeTracker
implements CollectionChangeTracker

Default CollectionChangeTracker.

Author:
Abe White

Field Summary
 
Fields inherited from class org.apache.openjpa.util.AbstractChangeTracker
add, change, rem
 
Constructor Summary
CollectionChangeTrackerImpl(Collection coll, boolean dups, boolean order)
          Constructor.
 
Method Summary
protected  void add(Object elem)
          Mark the given value as added.
 void added(Object elem)
          Notify the tracker that the given object was added.
 boolean allowsDuplicates()
          Whether the underlying collection allows duplicates.
protected  void change(Object elem)
          Mark the given value as changed.
protected  int initialSequence()
          Return the initial sequence value for this proxy.
 boolean isOrdered()
          Whether the underlying collection is ordered.
protected  void remove(Object elem)
          Mark the given value as removed.
 void removed(Object elem)
          Notify 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, stopTracking
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface org.apache.openjpa.util.ChangeTracker
getAdded, getChanged, getNextSequence, getRemoved, isTracking, setNextSequence, startTracking, stopTracking
 

Constructor Detail

CollectionChangeTrackerImpl

public CollectionChangeTrackerImpl(Collection coll,
                                   boolean dups,
                                   boolean order)
Constructor.

Parameters:
coll - the collection to delegate to
dups - true if the collection allows duplicates, false otherwise
order - true if the collection is ordered, false otherwise
Method Detail

allowsDuplicates

public boolean allowsDuplicates()
Whether the underlying collection allows duplicates.


isOrdered

public boolean isOrdered()
Whether the underlying collection is ordered.


added

public void added(Object elem)
Description copied from class: AbstractChangeTracker
Notify the tracker that the given object was added.

Specified by:
added in interface CollectionChangeTracker
Overrides:
added in class AbstractChangeTracker

removed

public void removed(Object elem)
Description copied from class: AbstractChangeTracker
Notify the tracker that the given object was removed.

Specified by:
removed in interface CollectionChangeTracker
Overrides:
removed in class AbstractChangeTracker

initialSequence

protected int initialSequence()
Description copied from class: AbstractChangeTracker
Return the initial sequence value for this proxy. Typically this is the container size. Assumes an unordered collection by default, returning 0.

Overrides:
initialSequence in class AbstractChangeTracker

add

protected void add(Object elem)
Description copied from class: AbstractChangeTracker
Mark the given value as added.

Specified by:
add in class AbstractChangeTracker

remove

protected void remove(Object elem)
Description copied from class: AbstractChangeTracker
Mark the given value as removed.

Specified by:
remove in class AbstractChangeTracker

change

protected void change(Object elem)
Description copied from class: AbstractChangeTracker
Mark the given value as changed.

Specified by:
change in class AbstractChangeTracker


Copyright © 2006-2007 Apache Software Foundation. All Rights Reserved.