soot.util
Class DeterministicHashMap

java.lang.Object
  extended by java.util.AbstractMap<K,V>
      extended by java.util.HashMap
          extended by soot.util.DeterministicHashMap
All Implemented Interfaces:
Serializable, Cloneable, Map

public class DeterministicHashMap
extends HashMap

Implementation of HashMap which guarantees a stable (between executions) order for its elements upon iteration. This is quite useful for maps of Locals, to avoid nondeterministic local-name drift.

See Also:
Serialized Form

Nested Class Summary
 
Nested classes/interfaces inherited from class java.util.AbstractMap
AbstractMap.SimpleEntry<K,V>, AbstractMap.SimpleImmutableEntry<K,V>
 
Constructor Summary
DeterministicHashMap(int initialCapacity)
          Constructs a DeterministicHashMap with the given initial capacity.
DeterministicHashMap(int initialCapacity, float loadFactor)
          Constructs a DeterministicHashMap with the given initial capacity and load factor.
 
Method Summary
 Collection entries()
          Returns a backed list of entries for this HashMap (unsupported).
 Set<Object> keySet()
          Returns a backed list of keys for this HashMap (unsupported).
 Object put(Object key, Object value)
          Inserts a mapping in this HashMap from key to value.
 Object remove(Object obj)
          Removes the given object from this HashMap (unsupported).
 
Methods inherited from class java.util.HashMap
clear, clone, containsKey, containsValue, entrySet, get, isEmpty, putAll, size, values
 
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

DeterministicHashMap

public DeterministicHashMap(int initialCapacity)
Constructs a DeterministicHashMap with the given initial capacity.


DeterministicHashMap

public DeterministicHashMap(int initialCapacity,
                            float loadFactor)
Constructs a DeterministicHashMap with the given initial capacity and load factor.

Method Detail

put

public Object put(Object key,
                  Object value)
Inserts a mapping in this HashMap from key to value.

Specified by:
put in interface Map
Overrides:
put in class HashMap

entries

public Collection entries()
Returns a backed list of entries for this HashMap (unsupported).


remove

public Object remove(Object obj)
Removes the given object from this HashMap (unsupported).

Specified by:
remove in interface Map
Overrides:
remove in class HashMap

keySet

public Set<Object> keySet()
Returns a backed list of keys for this HashMap (unsupported).

Specified by:
keySet in interface Map
Overrides:
keySet in class HashMap