edu.stanford.nlp.util
Class Counter

java.lang.Object
  |
  +--edu.stanford.nlp.util.Counter

public class Counter
extends Object

Counts occurrences of objects. In a floating point sort of a way.


Constructor Summary
Counter()
           
 
Method Summary
 void add(Object o)
          Add a count of 1.0 for object.
 void add(Object o, double d)
           
 void addCounter(Counter c)
           
 double countOf(Object o)
           
 boolean hasSeen(Object o)
           
 Set seenSet()
           
 void setCount(Object o, double d)
           
 String toString()
           
 int total()
          Returns total count for all objects in Counter
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

Counter

public Counter()
Method Detail

total

public int total()
Returns total count for all objects in Counter


hasSeen

public boolean hasSeen(Object o)

seenSet

public Set seenSet()

countOf

public double countOf(Object o)

setCount

public void setCount(Object o,
                     double d)

add

public void add(Object o)
Add a count of 1.0 for object.


add

public void add(Object o,
                double d)

addCounter

public void addCounter(Counter c)

toString

public String toString()
Overrides:
toString in class Object


Stanford NLP Group