站内搜索: 请输入搜索关键词
当前页面: 在线文档首页 > Hibernate 2.1.8 正式版 API 英文文档

IdentityMap (Hibernate API Documentation) - Hibernate 2.1.8 正式版 API 英文文档


net.sf.hibernate.util
Class IdentityMap

java.lang.Object
  extended bynet.sf.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().


Nested Class Summary
static class IdentityMap.IdentityKey
           
static class IdentityMap.IdentityMapEntry
           
 
Nested classes inherited from class java.util.Map
Map.Entry
 
Method Summary
 void clear()
           
static List concurrentEntries(Map map)
          Return the map entries (as instances of Map.Entry in a collection that is safe from concurrent modification).
 boolean containsKey(Object key)
           
 boolean containsValue(Object val)
           
static Map deserialize(Object o)
          Workaround for a JDK 1.4.1 bug where IdentityHashMaps are not correctly deserialized.
static List entries(Map map)
           
 List entryList()
           
 Set entrySet()
           
 Object get(Object key)
           
static Map instantiate(int size)
          Return a new instance of this class, with an undefined iteration order
static Map instantiateSequenced(int size)
          Return a new instance of this class, with iteration order defined by the order that entries were added
 boolean isEmpty()
           
 Iterator keyIterator()
           
static Iterator keyIterator(Map map)
           
 Set keySet()
           
 Object put(Object key, Object value)
           
 void putAll(Map otherMap)
           
 Object remove(Object key)
           
static Object serialize(Map map)
          Workaround for a JDK 1.4.1 bug where IdentityHashMaps are not correctly deserialized.
 int size()
           
 Collection values()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface java.util.Map
equals, hashCode
 

Method Detail

instantiate

public static Map instantiate(int size)
Return a new instance of this class, with an undefined iteration order

Returns:
Map

instantiateSequenced

public static Map instantiateSequenced(int size)
Return a new instance of this class, with iteration order defined by the order that entries were added


concurrentEntries

public static List 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()

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