Package org.apache.openjpa.util
Class MapChangeTrackerImpl
- java.lang.Object
-
- org.apache.openjpa.util.AbstractChangeTracker
-
- org.apache.openjpa.util.MapChangeTrackerImpl
-
- All Implemented Interfaces:
ChangeTracker
,MapChangeTracker
public class MapChangeTrackerImpl extends AbstractChangeTracker implements MapChangeTracker
DefaultMapChangeTracker
.- Author:
- Abe White
-
-
Field Summary
-
Fields inherited from class org.apache.openjpa.util.AbstractChangeTracker
add, change, rem
-
-
Constructor Summary
Constructors Constructor Description MapChangeTrackerImpl(java.util.Map map, boolean autoOff)
Constructor; supply delegate map.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected void
add(java.lang.Object obj)
Mark the given value as added.void
added(java.lang.Object key, java.lang.Object val)
Record that the given entry was added to the map.protected void
change(java.lang.Object key)
Mark the given value as changed.void
changed(java.lang.Object key, java.lang.Object oldVal, java.lang.Object newVal)
Record that the given entry was altered.boolean
getTrackKeys()
Whether to track keys or values.protected void
remove(java.lang.Object obj)
Mark the given value as removed.void
removed(java.lang.Object key, java.lang.Object val)
Record that the given entry was removed from the map.void
setTrackKeys(boolean keys)
Whether to track keys or values.-
Methods inherited from class org.apache.openjpa.util.AbstractChangeTracker
added, changed, getAdded, getAutoOff, getChanged, getNextSequence, getRemoved, initialSequence, isTracking, newSet, removed, 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
-
-
-
-
Method Detail
-
getTrackKeys
public boolean getTrackKeys()
Description copied from interface:MapChangeTracker
Whether to track keys or values. Defaults to keys. If you set to values, it is assumed there is a 1-1 correlation between keys and values in this map.- Specified by:
getTrackKeys
in interfaceMapChangeTracker
-
setTrackKeys
public void setTrackKeys(boolean keys)
Description copied from interface:MapChangeTracker
Whether to track keys or values. Defaults to keys. If you set to values, it is assumed there is a 1-1 correlation between keys and values in this map.- Specified by:
setTrackKeys
in interfaceMapChangeTracker
-
added
public void added(java.lang.Object key, java.lang.Object val)
Description copied from interface:MapChangeTracker
Record that the given entry was added to the map.- Specified by:
added
in interfaceMapChangeTracker
-
removed
public void removed(java.lang.Object key, java.lang.Object val)
Description copied from interface:MapChangeTracker
Record that the given entry was removed from the map.- Specified by:
removed
in interfaceMapChangeTracker
-
changed
public void changed(java.lang.Object key, java.lang.Object oldVal, java.lang.Object newVal)
Description copied from interface:MapChangeTracker
Record that the given entry was altered.- Specified by:
changed
in interfaceMapChangeTracker
-
add
protected void add(java.lang.Object obj)
Description copied from class:AbstractChangeTracker
Mark the given value as added.- Specified by:
add
in classAbstractChangeTracker
-
remove
protected void remove(java.lang.Object obj)
Description copied from class:AbstractChangeTracker
Mark the given value as removed.- Specified by:
remove
in classAbstractChangeTracker
-
change
protected void change(java.lang.Object key)
Description copied from class:AbstractChangeTracker
Mark the given value as changed.- Specified by:
change
in classAbstractChangeTracker
-
-