|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
public interface Counter<E>
Basic Object to double map. Utility functions are contained in
Counters
. Class previously known as Counter has been
renamed ot ClassicCounter
and many of its functions deprecated
in preference to those in Counters
. The preferred Counter
implementation is OpenAddressCounter.
Method Summary | |
---|---|
void |
clear()
Removes all entries from the counter |
boolean |
containsKey(E key)
|
double |
decrementCount(E key)
Decrements the count for this key by 1.0. |
double |
decrementCount(E key,
double value)
Decrements the count for this key by the given value. |
double |
defaultReturnValue()
Returns the default return value. |
void |
defaultReturnValue(double rv)
Sets the default return value. |
Set<Map.Entry<E,Double>> |
entrySet()
Returns a view of the entries in this counter |
double |
getCount(E key)
Returns the count for this key as a double. |
Factory<Counter<E>> |
getFactory()
Returns a factory that can create new instances of this kind of Counter. |
double |
incrementCount(E key)
Increments the count for this key by 1.0. |
double |
incrementCount(E key,
double value)
Increments the count for this key by the given value. |
Set<E> |
keySet()
Returns the Set of keys in this counter. |
double |
logIncrementCount(E key,
double value)
log space increments the count for this key by the given value. |
double |
remove(E key)
Removes the value associated with the given key. |
void |
setCount(E key,
double value)
Sets the count for this key to be the given value. |
int |
size()
Returns the number of entries in this counter. |
double |
totalCount()
Computes the total of all counts in this counter, and returns it as a double. |
Collection<Double> |
values()
Returns a copy of the values currently in this counter. |
Method Detail |
---|
Factory<Counter<E>> getFactory()
void defaultReturnValue(double rv)
rv
- The default valuedouble defaultReturnValue()
double getCount(E key)
key
- The key
void setCount(E key, double value)
key
- The keyvalue
- The countdouble incrementCount(E key, double value)
key
- The key to incrementvalue
- The amount to increment it by
double incrementCount(E key)
key
- The key to increment by 1.0
double decrementCount(E key, double value)
key
- The key to decrementvalue
- The amount to decrement it by
double decrementCount(E key)
key
- The key to decrement by 1.0
double logIncrementCount(E key, double value)
key
- The key to incrementvalue
- The amount to increment it by, in log space
double remove(E key)
boolean containsKey(E key)
Set<E> keySet()
Collection<Double> values()
Set<Map.Entry<E,Double>> entrySet()
void clear()
int size()
double totalCount()
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |