public class Object2IntFrequencyDistributionEntry<K extends Comparable<K>> extends Object implements Object2IntFrequencyDistribution<K>
Object2IntFrequencyDistribution based on HMapKI.SortableEntries.Order| Constructor and Description |
|---|
Object2IntFrequencyDistributionEntry() |
| 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 k)
Returns
true if key exists in this object. |
void |
decrement(K key)
Decrements the count of an event
key. |
void |
decrement(K key,
int cnt)
Decrements the count of a particular event
key by cnt. |
int |
get(K k)
Returns the count of a particular event
key. |
List<PairOfObjectInt<K>> |
getEntries(SortableEntries.Order ordering) |
List<PairOfObjectInt<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,
int cnt)
Increments the count of an event
key by cnt. |
Iterator<PairOfObjectInt<K>> |
iterator()
Iterator returns the same object every time, just with a different payload.
|
Set<K> |
keySet()
Returns the set of keys.
|
int |
remove(K k)
Removes the count of a particular event
key. |
int |
set(K k,
int v)
Sets the count of a particular event
key to cnt. |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitforEach, spliteratorpublic Object2IntFrequencyDistributionEntry()
public void increment(K key)
Object2IntFrequencyDistributionkey.increment in interface Object2IntFrequencyDistribution<K extends Comparable<K>>public void increment(K key, int cnt)
Object2IntFrequencyDistributionkey by cnt.increment in interface Object2IntFrequencyDistribution<K extends Comparable<K>>public void decrement(K key)
Object2IntFrequencyDistributionkey.decrement in interface Object2IntFrequencyDistribution<K extends Comparable<K>>public void decrement(K key, int cnt)
Object2IntFrequencyDistributionkey by cnt.decrement in interface Object2IntFrequencyDistribution<K extends Comparable<K>>public boolean contains(K k)
Object2IntFrequencyDistributiontrue if key exists in this object.contains in interface Object2IntFrequencyDistribution<K extends Comparable<K>>public int get(K k)
Object2IntFrequencyDistributionkey.get in interface Object2IntFrequencyDistribution<K extends Comparable<K>>public int set(K k, int v)
Object2IntFrequencyDistributionkey to cnt.set in interface Object2IntFrequencyDistribution<K extends Comparable<K>>public double computeRelativeFrequency(K k)
Object2IntFrequencyDistributionkey. That is,
f(key) / SUM_i f(key_i).computeRelativeFrequency in interface Object2IntFrequencyDistribution<K extends Comparable<K>>public double computeLogRelativeFrequency(K k)
Object2IntFrequencyDistributionkey.computeLogRelativeFrequency in interface Object2IntFrequencyDistribution<K extends Comparable<K>>public int remove(K k)
Object2IntFrequencyDistributionkey.remove in interface Object2IntFrequencyDistribution<K extends Comparable<K>>public void clear()
Object2IntFrequencyDistributionclear in interface Object2IntFrequencyDistribution<K extends Comparable<K>>public int getNumberOfEvents()
Object2IntFrequencyDistributiongetNumberOfEvents in interface Object2IntFrequencyDistribution<K extends Comparable<K>>public long getSumOfCounts()
Object2IntFrequencyDistributionSUM_i f(key_i).getSumOfCounts in interface Object2IntFrequencyDistribution<K extends Comparable<K>>public Set<K> keySet()
Object2IntFrequencyDistributionkeySet in interface Object2IntFrequencyDistribution<K extends Comparable<K>>public Iterator<PairOfObjectInt<K>> iterator()
iterator in interface Iterable<PairOfObjectInt<K extends Comparable<K>>>public List<PairOfObjectInt<K>> getEntries(SortableEntries.Order ordering)
getEntries in interface SortableEntries<PairOfObjectInt<K extends Comparable<K>>>public List<PairOfObjectInt<K>> getEntries(SortableEntries.Order ordering, int n)
getEntries in interface SortableEntries<PairOfObjectInt<K extends Comparable<K>>>Copyright © 2018. All rights reserved.