public abstract class AbstractCounter<E> extends java.lang.Object implements Counter<E>
Counter
.Constructor and Description |
---|
AbstractCounter() |
Modifier and Type | Method and Description |
---|---|
void |
addAll(Counter<E> counter)
Adds the counts in the given Counter to the counts in this Counter.
|
double |
decrementCount(E key)
Decrements the count for this key by 1.0.
|
double |
decrementCount(E key,
double amount)
Decrements the count for this key by the given value.
|
double |
incrementCount(E key)
Increments the count for this key by 1.0.
|
double |
incrementCount(E key,
double amount)
Increments the count for the given key by the given value.
|
double |
logIncrementCount(E key,
double amount)
Increments the count stored in log space for this key by the given
log-transformed value.
|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
clear, containsKey, defaultReturnValue, entrySet, getCount, getFactory, keySet, remove, setCount, setDefaultReturnValue, size, totalCount, values
prettyLog
public double logIncrementCount(E key, double amount)
Counter
Counter.setCount(Object,double)
.logIncrementCount
in interface Counter<E>
key
- The key to incrementamount
- The amount to increment it by, in log spacepublic double incrementCount(E key, double amount)
Counter
Counter.incrementCount(Object)
.
To set a count to a specific value instead of incrementing it, use
Counter.setCount(Object,double)
.incrementCount
in interface Counter<E>
key
- The key to incrementamount
- The amount to increment it bypublic double incrementCount(E key)
Counter
Counter.incrementCount(Object,double)
.
To set a count to a specific value instead of incrementing it, use
Counter.setCount(Object,double)
.incrementCount
in interface Counter<E>
key
- The key to increment by 1.0public double decrementCount(E key, double amount)
Counter
incrementCount
.
To more conveniently decrement the count by 1.0, use
Counter.decrementCount(Object)
.
To set a count to a specific value instead of decrementing it, use
Counter.setCount(Object,double)
.decrementCount
in interface Counter<E>
key
- The key to decrementamount
- The amount to decrement it bypublic double decrementCount(E key)
Counter
Counter.decrementCount(Object,double)
.
To set a count to a specific value instead of decrementing it, use
Counter.setCount(Object,double)
.decrementCount
in interface Counter<E>
key
- The key to decrement by 1.0