org.jboss.metadata.plugins.cache
Class ConcurrentHashMapCache<K,V>

java.lang.Object
  extended by org.jboss.metadata.plugins.cache.ConcurrentHashMapCache<K,V>
Type Parameters:
K - the key class
V - the value class
All Implemented Interfaces:
Cache<K,V>

public class ConcurrentHashMapCache<K,V>
extends Object
implements Cache<K,V>

Simple map backed-up cache.

Author:
Ales Justin

Constructor Summary
ConcurrentHashMapCache()
           
 
Method Summary
 void clear()
          Clear node.
 V get(K key)
          Get value under key.
 V put(K key, V value)
          Put value under key.
 V remove(K key)
          Remove value under key.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ConcurrentHashMapCache

public ConcurrentHashMapCache()
Method Detail

put

public V put(K key,
             V value)
Description copied from interface: Cache
Put value under key.

Specified by:
put in interface Cache<K,V>
Parameters:
key - the key
value - the value
Returns:
old value if exists

get

public V get(K key)
Description copied from interface: Cache
Get value under key.

Specified by:
get in interface Cache<K,V>
Parameters:
key - the key
Returns:
old value if exists

remove

public V remove(K key)
Description copied from interface: Cache
Remove value under key.

Specified by:
remove in interface Cache<K,V>
Parameters:
key - the key
Returns:
removed value

clear

public void clear()
Description copied from interface: Cache
Clear node.

Specified by:
clear in interface Cache<K,V>


Copyright © 2010 JBoss, a division of Red Hat, Inc.. All Rights Reserved.