public class RefCountedSet<K> extends Object
Modifier and Type | Field and Description |
---|---|
static EPTypeClass |
EPTYPE |
Constructor and Description |
---|
RefCountedSet()
Constructor.
|
RefCountedSet(Map<K,Integer> refSet,
int numValues) |
Modifier and Type | Method and Description |
---|---|
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.
|
int |
getNumValues() |
Map<K,Integer> |
getRefSet() |
Iterator<K> |
keyIterator()
Returns a key iterator.
|
static RefCountedSet<Double> |
readPointsDouble(DataInput input)
NOTE: Code-generation-invoked method, method name and parameter order matters
|
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.
|
static void |
writePointsDouble(DataOutput output,
RefCountedSet<Double> valueSet)
NOTE: Code-generation-invoked method, method name and parameter order matters
|
public static final EPTypeClass EPTYPE
public void clear()
public boolean add(K key)
key
- to addpublic void add(K key, int numReferences)
key
- to addnumReferences
- initial number of referencespublic boolean remove(K key)
key
- to addIllegalStateException
- is a key is removed that wasn't added to the mappublic boolean removeAll(K key)
key
- to addIllegalStateException
- if a key is removed that wasn't added to the mappublic Iterator<Map.Entry<K,Integer>> entryIterator()
public int size()
public int getNumValues()
public void setNumValues(int numValues)
public static void writePointsDouble(DataOutput output, RefCountedSet<Double> valueSet) throws IOException
output
- outputvalueSet
- valuesIOException
- io errorpublic static RefCountedSet<Double> readPointsDouble(DataInput input) throws IOException
input
- inputIOException
- io errorCopyright © 2005–2021. All rights reserved.