|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectedu.stanford.nlp.stats.AbstractCounter<E>
public abstract class AbstractCounter<E>
Default implementations of all the convenience methods provided by
Counter
.
Constructor Summary | |
---|---|
AbstractCounter()
|
Method Summary | |
---|---|
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. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Methods inherited from interface edu.stanford.nlp.stats.Counter |
---|
clear, containsKey, defaultReturnValue, entrySet, getCount, getFactory, keySet, remove, setCount, setDefaultReturnValue, size, totalCount, values |
Constructor Detail |
---|
public AbstractCounter()
Method Detail |
---|
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 space
public double incrementCount(E key, double amount)
Counter
Counter.incrementCount(Object)
.
To set a count to a specifc 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 by
public double incrementCount(E key)
Counter
Counter.incrementCount(Object,double)
.
To set a count to a specifc value instead of incrementing it, use
Counter.setCount(Object,double)
.
incrementCount
in interface Counter<E>
key
- The key to increment by 1.0
public double decrementCount(E key, double amount)
Counter
Counter.decrementCount(Object)
.
To set a count to a specifc 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 by
public double decrementCount(E key)
Counter
Counter.decrementCount(Object,double)
.
To set a count to a specifc value instead of decrementing it, use
Counter.setCount(Object,double)
.
decrementCount
in interface Counter<E>
key
- The key to decrement by 1.0
public void addAll(Counter<E> counter)
addAll
in interface Counter<E>
counter
- The Counter whose counts will be added. For each key in
counter, if it is not in this, then it will be added with value
counter.getCount(key)
. Otherwise, it will have value
this.getCount(key) + counter.getCount(key)
.
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |