com.googlecode.jweb1t
Class FrequencyDistribution<T>

java.lang.Object
  extended by com.googlecode.jweb1t.FrequencyDistribution<T>

public class FrequencyDistribution<T>
extends Object

Represents a frequency distribution as a efficient map (inspired by nltk.probability.FreqDist).

Author:
zesch

Constructor Summary
FrequencyDistribution()
           
FrequencyDistribution(Iterable<T> aIterable)
           
 
Method Summary
 void addSample(T aSample, long aNumber)
           
 boolean contains(T aSample)
           
 long getB()
           
 long getCount(T aSample)
           
 Set<T> getKeys()
           
 long getN()
           
 void inc(T aSample)
           
 void incAll(Iterable<T> aIterable)
           
 String toString()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

FrequencyDistribution

public FrequencyDistribution()

FrequencyDistribution

public FrequencyDistribution(Iterable<T> aIterable)
Method Detail

contains

public boolean contains(T aSample)

inc

public void inc(T aSample)

incAll

public void incAll(Iterable<T> aIterable)

getN

public long getN()
Returns:
The total number of sample outcomes that have been recorded by this FreqDist.

getB

public long getB()
Returns:
The total number of sample values (or bins) that have counts greater than zero.

getCount

public long getCount(T aSample)

getKeys

public Set<T> getKeys()

addSample

public void addSample(T aSample,
                      long aNumber)

toString

public String toString()
Overrides:
toString in class Object


Copyright © 2012. All Rights Reserved.