edu.stanford.nlp.stats
Interface GenericCounter<E>

All Known Implementing Classes:
Counter, IntCounter

public interface GenericCounter<E>

Interface to a generic (type-independent) Counter. We go through this interface whenever possible to keep generic the higher-level routines in Distribution and Counters.


Method Summary
 double doubleMax()
          Returns the value of the maximum entry in this counter, as a double.
 double getCount(E key)
          Returns the count for this key as a double.
 String getCountAsString(E key)
          Returns the count for this key as a String.
 MapFactory getMapFactory()
          Returns the MapFactory used by this counter.
 Set<E> keySet()
          Returns the Set of keys in this counter.
 void setCount(E key, String s)
          Sets the count for this key to be the number encoded in the given String.
 int size()
          Returns the number of entries in this counter.
 double totalDoubleCount()
          Computes the total of all counts in this counter, and returns it as a double.
 

Method Detail

getCount

double getCount(E key)
Returns the count for this key as a double.


getCountAsString

String getCountAsString(E key)
Returns the count for this key as a String.


setCount

void setCount(E key,
              String s)
Sets the count for this key to be the number encoded in the given String.


totalDoubleCount

double totalDoubleCount()
Computes the total of all counts in this counter, and returns it as a double.


keySet

Set<E> keySet()
Returns the Set of keys in this counter.


size

int size()
Returns the number of entries in this counter.


doubleMax

double doubleMax()
Returns the value of the maximum entry in this counter, as a double.


getMapFactory

MapFactory getMapFactory()
Returns the MapFactory used by this counter.



Stanford NLP Group