Groovy 2.2.0

org.codehaus.groovy.util
[Java] Class ManagedConcurrentValueMap

java.lang.Object
  org.codehaus.groovy.util.ManagedConcurrentValueMap

public class ManagedConcurrentValueMap
extends Object

This is a basic implementation of a map able to forget its values. This map uses internally a ConcurrentHashMap, thus should be save for concurrency. hashcode and equals are used to find the entries and should thus be implemented properly for the keys. This map does not support null keys.

Parameters:
- the key type
- the value type
Authors:
Jochen "blackdrag" Theodorou


Constructor Summary
ManagedConcurrentValueMap(ReferenceBundle bundle)

 
Method Summary
Object get(Object key)

Returns the value stored for the given key at the point of call.

void put(Object key, Object value)

Sets a new value for a given key. an older value is overwritten.

void setBundle(ReferenceBundle bundle)

Sets a new bundle used for reference creation.

 
Methods inherited from class Object
wait, wait, wait, equals, toString, hashCode, getClass, notify, notifyAll
 

Constructor Detail

ManagedConcurrentValueMap

public ManagedConcurrentValueMap(ReferenceBundle bundle)


 
Method Detail

get

public Object get(Object key)
Returns the value stored for the given key at the point of call.
Parameters:
key - a non null key
Returns:
the value stored in the map for the given key


put

public void put(Object key, Object value)
Sets a new value for a given key. an older value is overwritten.
Parameters:
key - a non null key
value - the new value


setBundle

public void setBundle(ReferenceBundle bundle)
Sets a new bundle used for reference creation. Be warned that older entries will not be changed by this
Parameters:
bundle - - the ReferenceBundle


 

Copyright © 2003-2013 The Codehaus. All rights reserved.