Framework Professional Edition Package


com.prosyst.util.hash
Class TrackingHashtable

java.lang.Object
  extended by java.util.Dictionary
      extended by java.util.Hashtable
          extended by com.prosyst.util.hash.TrackingHashtable
All Implemented Interfaces:
java.io.Serializable, java.lang.Cloneable, java.util.Map

public class TrackingHashtable
extends java.util.Hashtable

An implementation of Hashtable which tracks all changes made in the table. This version is only 1.1 compatible and DOES NOT track changes made in the table from Set or Collection views, and from the JDK 1.2 method putAll.

Author:
Nikolay Kristev
See Also:
Serialized Form

Constructor Summary
TrackingHashtable(java.util.Hashtable source)
          Create a TrackingHashtable which is populated with the elements in another Hashtable
 
Method Summary
 java.util.Vector getChanges()
           
 java.lang.Object put(java.lang.Object key, java.lang.Object value)
           
 java.lang.Object remove(java.lang.Object key)
           
 void startTracking(boolean deleteRecords)
          Start tracking changes in the Hashtable
 void stopTracking(boolean deleteRecords)
          Stop tracking changes in the Hashtable
 
Methods inherited from class java.util.Hashtable
clear, clone, contains, containsKey, containsValue, elements, entrySet, equals, get, hashCode, isEmpty, keys, keySet, putAll, rehash, size, toString, values
 
Methods inherited from class java.lang.Object
finalize, getClass, notify, notifyAll, wait, wait, wait
 

Constructor Detail

TrackingHashtable

public TrackingHashtable(java.util.Hashtable source)
Create a TrackingHashtable which is populated with the elements in another Hashtable

Parameters:
source - the Hashtable to use for starting elements. If it is null or empty Hashtable, just do not use any starting elements.
Method Detail

startTracking

public void startTracking(boolean deleteRecords)
Start tracking changes in the Hashtable

Parameters:
deleteRecords - if true, delete all records of changes

stopTracking

public void stopTracking(boolean deleteRecords)
Stop tracking changes in the Hashtable

Parameters:
deleteRecords - if true, delete all records of changes

getChanges

public java.util.Vector getChanges()

put

public java.lang.Object put(java.lang.Object key,
                            java.lang.Object value)
Specified by:
put in interface java.util.Map
Overrides:
put in class java.util.Hashtable

remove

public java.lang.Object remove(java.lang.Object key)
Specified by:
remove in interface java.util.Map
Overrides:
remove in class java.util.Hashtable

Framework Professional Edition Package


Copyright © 1999-2007 ProSyst Software GmbH. All Rights Reserved