|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objecttl.lin.data.fd.Object2LongFrequencyDistributionEntry<K>
public class Object2LongFrequencyDistributionEntry<K extends Comparable<K>>
Implementation of Object2LongFrequencyDistribution based on HMapKL.
| Nested Class Summary |
|---|
| Nested classes/interfaces inherited from interface tl.lin.data.SortableEntries |
|---|
SortableEntries.Order |
| Constructor Summary | |
|---|---|
Object2LongFrequencyDistributionEntry()
|
|
| Method Summary | |
|---|---|
void |
clear()
Removes all events. |
double |
computeLogRelativeFrequency(K k)
Computes the log (base e) of the relative frequency of a particular event key. |
double |
computeRelativeFrequency(K k)
Computes the relative frequency of a particular event key. |
boolean |
contains(K key)
Returns true if key exists in this object. |
void |
decrement(K key)
Decrements the count of an event key. |
void |
decrement(K key,
long cnt)
Decrements the count of a particular event key by cnt. |
long |
get(K key)
Returns the count of a particular event key. |
List<PairOfObjectLong<K>> |
getEntries(SortableEntries.Order ordering)
|
List<PairOfObjectLong<K>> |
getEntries(SortableEntries.Order ordering,
int n)
|
int |
getNumberOfEvents()
Returns number of distinct events observed. |
long |
getSumOfCounts()
Returns the sum of counts of all observed events. |
void |
increment(K key)
Increments the count of an event key. |
void |
increment(K key,
long cnt)
Increments the count of an event key by cnt. |
Iterator<PairOfObjectLong<K>> |
iterator()
Iterator returns the same object every time, just with a different payload. |
Set<K> |
keySet()
Returns the set of keys. |
long |
remove(K k)
Removes the count of a particular event key. |
long |
set(K k,
long v)
Sets the count of a particular event key to cnt. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public Object2LongFrequencyDistributionEntry()
| Method Detail |
|---|
public void increment(K key)
Object2LongFrequencyDistributionkey.
increment in interface Object2LongFrequencyDistribution<K extends Comparable<K>>
public void increment(K key,
long cnt)
Object2LongFrequencyDistributionkey by cnt.
increment in interface Object2LongFrequencyDistribution<K extends Comparable<K>>public void decrement(K key)
Object2LongFrequencyDistributionkey.
decrement in interface Object2LongFrequencyDistribution<K extends Comparable<K>>
public void decrement(K key,
long cnt)
Object2LongFrequencyDistributionkey by cnt.
decrement in interface Object2LongFrequencyDistribution<K extends Comparable<K>>public boolean contains(K key)
Object2LongFrequencyDistributiontrue if key exists in this object.
contains in interface Object2LongFrequencyDistribution<K extends Comparable<K>>public long get(K key)
Object2LongFrequencyDistributionkey.
get in interface Object2LongFrequencyDistribution<K extends Comparable<K>>public double computeRelativeFrequency(K k)
Object2LongFrequencyDistributionkey.
That is, f(key) / SUM_i f(key_i).
computeRelativeFrequency in interface Object2LongFrequencyDistribution<K extends Comparable<K>>public double computeLogRelativeFrequency(K k)
Object2LongFrequencyDistributionkey.
computeLogRelativeFrequency in interface Object2LongFrequencyDistribution<K extends Comparable<K>>
public long set(K k,
long v)
Object2LongFrequencyDistributionkey to cnt.
set in interface Object2LongFrequencyDistribution<K extends Comparable<K>>public long remove(K k)
Object2LongFrequencyDistributionkey.
remove in interface Object2LongFrequencyDistribution<K extends Comparable<K>>public void clear()
Object2LongFrequencyDistribution
clear in interface Object2LongFrequencyDistribution<K extends Comparable<K>>public int getNumberOfEvents()
Object2LongFrequencyDistribution
getNumberOfEvents in interface Object2LongFrequencyDistribution<K extends Comparable<K>>public long getSumOfCounts()
Object2LongFrequencyDistributionSUM_i f(key_i).
getSumOfCounts in interface Object2LongFrequencyDistribution<K extends Comparable<K>>public Set<K> keySet()
Object2LongFrequencyDistribution
keySet in interface Object2LongFrequencyDistribution<K extends Comparable<K>>public Iterator<PairOfObjectLong<K>> iterator()
iterator in interface Iterable<PairOfObjectLong<K extends Comparable<K>>>public List<PairOfObjectLong<K>> getEntries(SortableEntries.Order ordering)
getEntries in interface SortableEntries<PairOfObjectLong<K extends Comparable<K>>>
public List<PairOfObjectLong<K>> getEntries(SortableEntries.Order ordering,
int n)
getEntries in interface SortableEntries<PairOfObjectLong<K extends Comparable<K>>>
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||