|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectedu.umd.cloud9.util.fd.Object2IntFrequencyDistributionFastutil<K>
public class Object2IntFrequencyDistributionFastutil<K extends Comparable<K>>
Implementation of Object2IntFrequencyDistribution based on
Object2IntOpenHashMap.
| Nested Class Summary |
|---|
| Nested classes/interfaces inherited from interface edu.umd.cloud9.util.SortableEntries |
|---|
SortableEntries.Order |
| Constructor Summary | |
|---|---|
Object2IntFrequencyDistributionFastutil()
|
|
| 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 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. |
|
Object2IntMap.FastEntrySet<K> |
entrySet()
Exposes efficient method for accessing mappings in this map. |
|
static
|
fromObject2IntOpenHashMap(Object2IntOpenHashMap<T> map)
|
|
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. |
|
Object2IntOpenHashMap<K> |
getObject2IntOpenHashMap()
Returns the underlying map backing this frequency distribution. |
|
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. |
|
IntCollection |
values()
Exposes efficient method for accessing values in this map. |
|
| Methods inherited from class java.lang.Object |
|---|
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public Object2IntFrequencyDistributionFastutil()
| Method Detail |
|---|
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 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 set(K k,
int v)
Object2IntFrequencyDistributionkey to cnt.
set in interface Object2IntFrequencyDistribution<K extends Comparable<K>>public int remove(K k)
Object2IntFrequencyDistributionkey.
remove in interface Object2IntFrequencyDistribution<K extends Comparable<K>>public void clear()
Object2IntFrequencyDistribution
clear in interface Object2IntFrequencyDistribution<K extends Comparable<K>>public IntCollection values()
public Object2IntMap.FastEntrySet<K> entrySet()
public Object2IntOpenHashMap<K> getObject2IntOpenHashMap()
public int getNumberOfEvents()
Object2IntFrequencyDistribution
getNumberOfEvents 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()
Object2IntFrequencyDistribution
keySet 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>>>public static <T extends Comparable<T>> Object2IntFrequencyDistributionFastutil<T> fromObject2IntOpenHashMap(Object2IntOpenHashMap<T> map)
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||