|
||||||||||
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. |
|
RefCountedSet(java.util.Map<K,java.lang.Integer> refSet,
int numValues)
|
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. |
java.util.Iterator<java.util.Map.Entry<K,java.lang.Integer>> |
entryIterator()
Returns an iterator over the entry set. |
int |
getNumValues()
|
java.util.Map<K,java.lang.Integer> |
getRefSet()
|
java.util.Iterator<K> |
keyIterator()
Returns a key iterator. |
boolean |
remove(K key)
Removed a key to the set. |
boolean |
removeAll(K key)
Remove a key from the set regardless of the number of references. |
void |
setNumValues(int numValues)
|
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()
public RefCountedSet(java.util.Map<K,java.lang.Integer> refSet, int numValues)
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
java.lang.IllegalStateException
- is a key is removed that wasn't added to the mappublic boolean removeAll(K key)
key
- to add
java.lang.IllegalStateException
- if a key is removed that wasn't added to the mappublic java.util.Iterator<java.util.Map.Entry<K,java.lang.Integer>> entryIterator()
public java.util.Iterator<K> keyIterator()
public int size()
public java.util.Map<K,java.lang.Integer> getRefSet()
public int getNumValues()
public void setNumValues(int numValues)
|
© 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 |