com.sun.jini.collection
Class WeakIdentityMap

java.lang.Object
  extended by com.sun.jini.collection.WeakIdentityMap

public class WeakIdentityMap
extends Object

Identity-based weak hash map.

Since:
2.0
Author:
Sun Microsystems, Inc.

Nested Class Summary
private static class WeakIdentityMap.Key
           
 
Field Summary
private  Map map
           
private  ReferenceQueue queue
           
 
Constructor Summary
WeakIdentityMap()
           
 
Method Summary
 void clear()
          Removes all associations from this map.
 Object get(Object key)
          Returns value associated with given key, or null if none.
private  void processQueue()
           
 Object put(Object key, Object value)
          Associates value with given key, returning value previously associated with key, or null if none.
 Object remove(Object key)
          Removes association for given key, returning value previously associated with key, or null if none.
 Collection values()
          Returns collection containing all values currently held in this map.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

map

private final Map map

queue

private final ReferenceQueue queue
Constructor Detail

WeakIdentityMap

public WeakIdentityMap()
Method Detail

put

public Object put(Object key,
                  Object value)
Associates value with given key, returning value previously associated with key, or null if none.


get

public Object get(Object key)
Returns value associated with given key, or null if none.


remove

public Object remove(Object key)
Removes association for given key, returning value previously associated with key, or null if none.


values

public Collection values()
Returns collection containing all values currently held in this map.


clear

public void clear()
Removes all associations from this map.


processQueue

private void processQueue()


Copyright 2007-2010, multiple authors.
Licensed under the Apache License, Version 2.0, see the NOTICE file for attributions.