org.onemind.commons.java.datastructure
Class TrackedMap

java.lang.Object
  extended byjava.util.AbstractMap
      extended byjava.util.HashMap
          extended byorg.onemind.commons.java.datastructure.TrackedMap
All Implemented Interfaces:
java.lang.Cloneable, java.util.Map, java.io.Serializable

public class TrackedMap
extends java.util.HashMap

A map that has it's map values changes tracked. It uses an inner map to keep the unchanged value and itself to track the changes

Version:
$Id: TrackedMap.java,v 1.2 2004/08/26 12:33:16 thlee Exp $ $Name: $
Author:
TiongHiang Lee (thlee@onemindsoft.org)
See Also:
Serialized Form

Constructor Summary
TrackedMap()
          {@inheritDoc}
TrackedMap(int initialCapacity)
          {@inheritDoc}
TrackedMap(int initialCapacity, float loadFactor)
          {@inheritDoc}
TrackedMap(java.util.Map map)
          {@inheritDoc}
 
Method Summary
 void clear()
          
 void clearChanges()
          Clear all the changes
 boolean containsKey(java.lang.Object key)
          
 boolean containsValue(java.lang.Object value)
          
 java.util.Set entrySet()
          
 java.lang.Object get(java.lang.Object key)
          
 java.util.Set getChangedKeySet()
          Return the key set of changed values
 boolean hasChanges()
          Return whether this map has been changes
 boolean isEmpty()
          
 java.util.Set keySet()
          
 void makeUpToDate()
          Make this map as up-to-date.
 java.lang.Object remove(java.lang.Object key)
          
 int size()
          
 java.util.Collection values()
          
 
Methods inherited from class java.util.HashMap
clone, put, putAll
 
Methods inherited from class java.util.AbstractMap
equals, hashCode, toString
 
Methods inherited from class java.lang.Object
finalize, getClass, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface java.util.Map
equals, hashCode
 

Constructor Detail

TrackedMap

public TrackedMap()
{@inheritDoc}


TrackedMap

public TrackedMap(int initialCapacity)
{@inheritDoc}


TrackedMap

public TrackedMap(int initialCapacity,
                  float loadFactor)
{@inheritDoc}


TrackedMap

public TrackedMap(java.util.Map map)
{@inheritDoc}

Method Detail

hasChanges

public boolean hasChanges()
Return whether this map has been changes

Returns:
true if it has been changed

getChangedKeySet

public java.util.Set getChangedKeySet()
Return the key set of changed values

Returns:
the key set

get

public java.lang.Object get(java.lang.Object key)


makeUpToDate

public void makeUpToDate()
Make this map as up-to-date.


clearChanges

public void clearChanges()
Clear all the changes


clear

public void clear()


containsKey

public boolean containsKey(java.lang.Object key)


containsValue

public boolean containsValue(java.lang.Object value)


entrySet

public java.util.Set entrySet()


isEmpty

public boolean isEmpty()


keySet

public java.util.Set keySet()


remove

public java.lang.Object remove(java.lang.Object key)


size

public int size()


values

public java.util.Collection values()



Copyright © 2004-2006 . All Rights Reserved.