public class Object2LongFrequencyDistributionEntry<K extends Comparable<K>> extends Object implements Object2LongFrequencyDistribution<K>
Object2LongFrequencyDistribution based on HMapKL.SortableEntries.Order| Constructor and Description |
|---|
Object2LongFrequencyDistributionEntry() |
| Modifier and Type | Method and Description |
|---|---|
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. |
public Object2LongFrequencyDistributionEntry()
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()
Object2LongFrequencyDistributionclear in interface Object2LongFrequencyDistribution<K extends Comparable<K>>public int getNumberOfEvents()
Object2LongFrequencyDistributiongetNumberOfEvents 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()
Object2LongFrequencyDistributionkeySet 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>>>Copyright © 2014. All rights reserved.