Class IdentityMap

java.lang.Object
org.hibernate.util.IdentityMap
All Implemented Interfaces:
Map

public final class IdentityMap extends Object implements Map
A Map where keys are compared by object identity, rather than equals().
  • Method Details

    • instantiate

      public static Map instantiate(int size)
      Return a new instance of this class, with an undefined iteration order.
      Parameters:
      size - The size of the map
      Returns:
      Map
    • instantiateSequenced

      public static Map instantiateSequenced(int size)
      Return a new instance of this class, with iteration order defined as the order in which entries were added
      Parameters:
      size - The size of the map to create
      Returns:
    • concurrentEntries

      public static Map.Entry[] concurrentEntries(Map map)
      Return the map entries (as instances of Map.Entry in a collection that is safe from concurrent modification). ie. we may safely add new instances to the underlying Map during iteration of the entries().
      Parameters:
      map -
      Returns:
      Collection
    • entries

      public static List entries(Map map)
    • keyIterator

      public static Iterator keyIterator(Map map)
    • keyIterator

      public Iterator keyIterator()
    • size

      public int size()
      Specified by:
      size in interface Map
    • isEmpty

      public boolean isEmpty()
      Specified by:
      isEmpty in interface Map
    • containsKey

      public boolean containsKey(Object key)
      Specified by:
      containsKey in interface Map
    • containsValue

      public boolean containsValue(Object val)
      Specified by:
      containsValue in interface Map
    • get

      public Object get(Object key)
      Specified by:
      get in interface Map
    • put

      public Object put(Object key, Object value)
      Specified by:
      put in interface Map
    • remove

      public Object remove(Object key)
      Specified by:
      remove in interface Map
    • putAll

      public void putAll(Map otherMap)
      Specified by:
      putAll in interface Map
    • clear

      public void clear()
      Specified by:
      clear in interface Map
    • keySet

      public Set keySet()
      Specified by:
      keySet in interface Map
    • values

      public Collection values()
      Specified by:
      values in interface Map
    • entrySet

      public Set entrySet()
      Specified by:
      entrySet in interface Map
    • entryList

      public List entryList()
    • entryArray

      public Map.Entry[] entryArray()
    • serialize

      public static Object serialize(Map map)
      Workaround for a JDK 1.4.1 bug where IdentityHashMaps are not correctly deserialized.
      Parameters:
      map -
      Returns:
      Object
    • deserialize

      public static Map deserialize(Object o)
      Workaround for a JDK 1.4.1 bug where IdentityHashMaps are not correctly deserialized.
      Parameters:
      o -
      Returns:
      Map
    • toString

      public String toString()
      Overrides:
      toString in class Object
    • invert

      public static Map invert(Map map)