Package soot.util

Class DeterministicHashMap<K,​V>

  • All Implemented Interfaces:
    Serializable, Cloneable, Map<K,​V>

    public class DeterministicHashMap<K,​V>
    extends HashMap<K,​V>
    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
    • 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 V put​(K key,
                     V value)
        Inserts a mapping in this HashMap from key to value.
        Specified by:
        put in interface Map<K,​V>
        Overrides:
        put in class HashMap<K,​V>
      • remove

        public V remove​(Object obj)
        Removes the given object from this HashMap (unsupported).
        Specified by:
        remove in interface Map<K,​V>
        Overrides:
        remove in class HashMap<K,​V>
      • keySet

        public Set<K> keySet()
        Returns a backed list of keys for this HashMap (unsupported).
        Specified by:
        keySet in interface Map<K,​V>
        Overrides:
        keySet in class HashMap<K,​V>