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

All Known Implementing Classes:
Counter

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
 java.util.Comparator<E> comparator()
          Returns a comparator
 boolean containsKey(E key)
           
 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.
 java.lang.String getCountAsString(E key)
          Returns the count for this key as a String.
 MapFactory getMapFactory()
          Returns the MapFactory used by this counter.
 java.util.Set<E> keySet()
          Returns the Set of keys in this counter.
 void setCount(E key, java.lang.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

containsKey

boolean containsKey(E key)
Returns:
true iff key is a key in this GenericCounter.

getCount

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


getCountAsString

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


setCount

void setCount(E key,
              java.lang.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

java.util.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.


comparator

java.util.Comparator<E> comparator()
Returns a comparator