tl.lin.data.fd
Interface Int2IntFrequencyDistribution

All Superinterfaces:
Iterable<PairOfInts>, SortableEntries<PairOfInts>
All Known Implementing Classes:
Int2IntFrequencyDistributionEntry

public interface Int2IntFrequencyDistribution
extends SortableEntries<PairOfInts>

A frequency distribution where events are ints and counts are ints.


Nested Class Summary
 
Nested classes/interfaces inherited from interface tl.lin.data.SortableEntries
SortableEntries.Order
 
Method Summary
 void clear()
          Removes all events.
 double computeLogRelativeFrequency(int key)
          Computes the log (base e) of the relative frequency of a particular event key.
 double computeRelativeFrequency(int key)
          Computes the relative frequency of a particular event key.
 boolean contains(int key)
          Returns true if key exists in this object.
 void decrement(int key)
          Decrements the count of an event key.
 void decrement(int key, int cnt)
          Decrements the count of a particular event key by cnt.
 int get(int key)
          Returns the count of a particular event key.
 int getNumberOfEvents()
          Returns number of distinct events observed.
 long getSumOfCounts()
          Returns the sum of counts of all observed events.
 void increment(int key)
          Increments the count of an event key.
 void increment(int key, int cnt)
          Increments the count of an event key by cnt.
 int remove(int key)
          Removes the count of a particular event key.
 int set(int key, int cnt)
          Sets the count of a particular event key to cnt.
 
Methods inherited from interface tl.lin.data.SortableEntries
getEntries, getEntries
 
Methods inherited from interface java.lang.Iterable
iterator
 

Method Detail

increment

void increment(int key)
Increments the count of an event key.


increment

void increment(int key,
               int cnt)
Increments the count of an event key by cnt.


decrement

void decrement(int key)
Decrements the count of an event key.


decrement

void decrement(int key,
               int cnt)
Decrements the count of a particular event key by cnt.


contains

boolean contains(int key)
Returns true if key exists in this object.


get

int get(int key)
Returns the count of a particular event key.


computeRelativeFrequency

double computeRelativeFrequency(int key)
Computes the relative frequency of a particular event key. That is, f(key) / SUM_i f(key_i).


computeLogRelativeFrequency

double computeLogRelativeFrequency(int key)
Computes the log (base e) of the relative frequency of a particular event key.


set

int set(int key,
        int cnt)
Sets the count of a particular event key to cnt.


remove

int remove(int key)
Removes the count of a particular event key.


clear

void clear()
Removes all events.


getNumberOfEvents

int getNumberOfEvents()
Returns number of distinct events observed. Note that if an event is observed and then its count subsequently removed, the event will not be included in this count.


getSumOfCounts

long getSumOfCounts()
Returns the sum of counts of all observed events. That is, SUM_i f(key_i).



Copyright © 2013. All Rights Reserved.