|
Parsing Engine | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
public interface CountsTable<K>
Specifies a mapping between objects and floating-point (double
)
counts that may be incremented or decremented.
Nested Class Summary |
---|
Nested classes/interfaces inherited from interface danbikel.util.MapToPrimitive |
---|
MapToPrimitive.Entry<K> |
Method Summary | |
---|---|
void |
add(K key)
Adds the specified key with a count of 1.0 . |
void |
addAll(CountsTable<K> other)
Adds all the counts from the specified table to this table, adding any new keys in the specified map to this map, if necessary. |
double |
count(K key)
Returns the count of the specified key, or 0 if this
counts table does not contain a count for the specified key. |
double |
count(K key,
int hashCode)
Returns the count of the specified key with the specified hash code, or 0 if this counts table does not contain a count for the
specified key. |
void |
output(String eventName,
Writer writer)
Outputs all the mappings of this map in as S-expressions of the form (name key value) |
void |
putAll(CountsTable<K> other)
Puts the specified map of key objects to their counts into this counts table. |
void |
removeItemsBelow(double threshold)
Removes items in this table whose counts are less than the specified threshold. |
Methods inherited from interface danbikel.util.MapToPrimitive |
---|
add, add, add, add, add, add, add, add, add, add, add, add, getEntry, getEntry, getEntryMRU, getEntryMRU, put, put, put, put, put, put, put, put, put, put, put, put, put, put, removeRandom, removeRandom |
Methods inherited from interface java.util.Map |
---|
clear, containsKey, containsValue, entrySet, equals, get, hashCode, isEmpty, keySet, put, putAll, remove, size, values |
Method Detail |
---|
void addAll(CountsTable<K> other)
other
- the other counts table whose counts are to be added
to this tablevoid putAll(CountsTable<K> other)
other
- another counts table whose counts are to be put into
this tablevoid add(K key)
1.0
.
key
- the key to be added to this counts tabledouble count(K key)
0
if this
counts table does not contain a count for the specified key.
key
- the key whose count is to be gotten
0
if this
counts table does not contain a count for the specified keydouble count(K key, int hashCode)
0
if this counts table does not contain a count for the
specified key.
key
- the key whose count is to be gottenhashCode
- the hash code of the specified key
0
if this counts table does not contain a count for the
specified keyvoid removeItemsBelow(double threshold)
threshold
- the count threshold below which to remove items from
this tablevoid output(String eventName, Writer writer) throws IOException
(name key value)
eventName
- the name of the events contained in this CountsTable
to output as the first symbol in the three-element listwriter
- the writer to which to output the elements of this
counts table as three-element S-expression lists
IOException
- if there is a problem writing to the specified
writer
|
Parsing Engine | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |