|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectcom.espertech.esper.collection.RefCountedSet<K>
public class RefCountedSet<K>
reference-counting set based on a HashMap implementation that stores keys and a reference counter for each unique key value. Each time the same key is added, the reference counter increases. Each time a key is removed, the reference counter decreases.
Constructor Summary | |
---|---|
RefCountedSet()
Constructor. |
Method Summary | |
---|---|
boolean |
add(K key)
Add a key to the set. |
void |
add(K key,
int numReferences)
Add a key to the set with the given number of references. |
void |
clear()
Clear out the collection. |
Iterator<Map.Entry<K,Integer>> |
entryIterator()
Returns an iterator over the entry set. |
boolean |
remove(K key)
Removed a key to the set. |
int |
size()
Returns the number of values in the collection. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public RefCountedSet()
Method Detail |
---|
public void clear()
public boolean add(K key)
key
- to add
public void add(K key, int numReferences)
key
- to addnumReferences
- initial number of referencespublic boolean remove(K key)
key
- to add
IllegalStateException
- is a key is removed that wasn't added to the mappublic Iterator<Map.Entry<K,Integer>> entryIterator()
public int size()
|
© 2007 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 |