edu.stanford.nlp.stats
Class AbstractCounter<E>

java.lang.Object
  extended by edu.stanford.nlp.stats.AbstractCounter<E>
All Implemented Interfaces:
Counter<E>
Direct Known Subclasses:
IntCounter

public abstract class AbstractCounter<E>
extends Object
implements Counter<E>

Default implementations of all the convenience methods provided by Counter.

Author:
dramage

Constructor Summary
AbstractCounter()
           
 
Method Summary
 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 this key by the given value.
 double logIncrementCount(E key, double amount)
          log space increments the count for this key by the given 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, defaultReturnValue, entrySet, getCount, getFactory, keySet, remove, setCount, size, totalCount, values
 

Constructor Detail

AbstractCounter

public AbstractCounter()
Method Detail

logIncrementCount

public double logIncrementCount(E key,
                                double amount)
Description copied from interface: Counter
log space increments the count for this key by the given value.

Specified by:
logIncrementCount in interface Counter<E>
Parameters:
key - The key to increment
amount - The amount to increment it by, in log space
Returns:
The value associated with they key, post-increment, in log space

incrementCount

public double incrementCount(E key,
                             double amount)
Description copied from interface: Counter
Increments the count for this key by the given value.

Specified by:
incrementCount in interface Counter<E>
Parameters:
key - The key to increment
amount - The amount to increment it by
Returns:
The value associated with they key, post-increment.

incrementCount

public double incrementCount(E key)
Description copied from interface: Counter
Increments the count for this key by 1.0.

Specified by:
incrementCount in interface Counter<E>
Parameters:
key - The key to increment by 1.0
Returns:
The value associated with they key, post-increment.

decrementCount

public double decrementCount(E key,
                             double amount)
Description copied from interface: Counter
Decrements the count for this key by the given value.

Specified by:
decrementCount in interface Counter<E>
Parameters:
key - The key to decrement
amount - The amount to decrement it by
Returns:
The value associated with they key, post-decrement.

decrementCount

public double decrementCount(E key)
Description copied from interface: Counter
Decrements the count for this key by 1.0.

Specified by:
decrementCount in interface Counter<E>
Parameters:
key - The key to decrement by 1.0
Returns:
The value of associated with they key, post-decrement.


Stanford NLP Group