com.sun.sgs.impl.util
Class WeakIdentityMap<K,V>

java.lang.Object
  extended by com.sun.sgs.impl.util.WeakIdentityMap<K,V>
Type Parameters:
K - the key type
V - the value type

public class WeakIdentityMap<K,V>
extends Object

A map that with weak keys that are compared for identity.


Constructor Summary
WeakIdentityMap()
          Creates an instance of this class.
 
Method Summary
 void clear()
          Removes all associations from this map.
 boolean containsKey(K key)
          Checks if the map contains the specified key.
 V get(Object key)
          Returns the value associated with given key, or null if the key is not found.
 V put(K key, V value)
          Associates a value with given key, returning the value previously associated with key, or null if none is found.
 V remove(Object key)
          Removes the association for the given key, returning the value previously associated with the key, or null if the key is not found.
 Collection<V> 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
 

Constructor Detail

WeakIdentityMap

public WeakIdentityMap()
Creates an instance of this class.

Method Detail

put

public V put(K key,
             V value)
Associates a value with given key, returning the value previously associated with key, or null if none is found.

Parameters:
key - the key
value - the value
Returns:
the previous value or null

containsKey

public boolean containsKey(K key)
Checks if the map contains the specified key.

Parameters:
key - the key
Returns:
true if the map contains the key, else false

get

public V get(Object key)
Returns the value associated with given key, or null if the key is not found.

Parameters:
key - the key
Returns:
the value associated with the key or null

remove

public V remove(Object key)
Removes the association for the given key, returning the value previously associated with the key, or null if the key is not found.

Parameters:
key - the key
Returns:
the value previously associated with the key or null

values

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

Returns:
a collection containing all values

clear

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


RedDwarf, Version 0.10.1
2010-03-14 10:56:12

Copyright © 2010 The RedDwarf Authors. All rights reserved
Copyright © 2007-2010 Sun Microsystems, Inc. All rights reserved