org.apache.openjpa.util
Class MapChangeTrackerImpl

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

public class MapChangeTrackerImpl
extends AbstractChangeTracker
implements MapChangeTracker

Default MapChangeTracker.

Author:
Abe White

Field Summary
 
Fields inherited from class org.apache.openjpa.util.AbstractChangeTracker
add, change, rem
 
Constructor Summary
MapChangeTrackerImpl(Map map)
          Constructor; supply delegate map.
 
Method Summary
protected  void add(Object obj)
          Mark the given value as added.
 void added(Object key, Object val)
          Record that the given entry was added to the map.
protected  void change(Object key)
          Mark the given value as changed.
 void changed(Object key, Object oldVal, Object newVal)
          Record that the given entry was altered.
 boolean getTrackKeys()
          Whether to track keys or values.
protected  void remove(Object obj)
          Mark the given value as removed.
 void removed(Object key, 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
 

Constructor Detail

MapChangeTrackerImpl

public MapChangeTrackerImpl(Map map)
Constructor; supply delegate map.

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 interface MapChangeTracker

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 interface MapChangeTracker

added

public void added(Object key,
                  Object val)
Description copied from interface: MapChangeTracker
Record that the given entry was added to the map.

Specified by:
added in interface MapChangeTracker

removed

public void removed(Object key,
                    Object val)
Description copied from interface: MapChangeTracker
Record that the given entry was removed from the map.

Specified by:
removed in interface MapChangeTracker

changed

public void changed(Object key,
                    Object oldVal,
                    Object newVal)
Description copied from interface: MapChangeTracker
Record that the given entry was altered.

Specified by:
changed in interface MapChangeTracker

add

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

Specified by:
add in class AbstractChangeTracker

remove

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

Specified by:
remove in class AbstractChangeTracker

change

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

Specified by:
change in class AbstractChangeTracker


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