|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectcom.espertech.esper.collection.RefCountedMap<K,V>
public class RefCountedMap<K,V>
Reference-counting map based on a HashMap implementation that stores as a value a pair of value and reference counter. The class provides a reference method that takes a key and increments the reference count for the key. It also provides a de-reference method that takes a key and decrements the reference count for the key, and removes the key if the reference count reached zero. Null values are not allowed as keys.
Constructor Summary | |
---|---|
RefCountedMap()
Constructor. |
Method Summary | |
---|---|
void |
clear()
Clear out the collection. |
boolean |
dereference(K key)
Decreases the reference count for a given key by one. |
V |
get(K key)
Get the value for a given key, returning null if the key was not found. |
V |
put(K key,
V value)
Add and key and value with a reference count as one. |
void |
reference(K key)
Increase the reference count for a given key by one. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public RefCountedMap()
Method Detail |
---|
public V put(K key, V value)
key
- to addvalue
- to add
public V get(K key)
key
- is the key to look up and return the value for
public void reference(K key)
key
- is the key to increase the ref count forpublic boolean dereference(K key)
key
- to de-reference
public void clear()
|
© 2006-2015 EsperTech Inc. All rights reserved. Visit us at espertech.com |
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |