|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
public interface Object2IntFrequencyDistribution<K extends Comparable<K>>
A frequency distribution where events are arbitrary objects and counts are ints.
| Method Summary | |
|---|---|
void |
clear()
Removes all events. |
boolean |
contains(K key)
Returns true if key exists in this object. |
void |
decrement(K key)
Decrements the frequency of an event key. |
void |
decrement(K key,
int cnt)
Decrements the frequency of a particular event key by cnt. |
int |
get(K key)
Returns the frequency of a particular event key. |
List<PairOfObjectInt<K>> |
getFrequencySortedEvents()
Returns events sorted by frequency of occurrence. |
List<PairOfObjectInt<K>> |
getFrequencySortedEvents(int n)
Returns top n events sorted by frequency of occurrence. |
int |
getNumberOfEvents()
Returns number of distinct events observed. |
List<PairOfObjectInt<K>> |
getSortedEvents()
Returns events in sorted order. |
List<PairOfObjectInt<K>> |
getSortedEvents(int n)
Returns top n events in sorted order. |
long |
getSumOfFrequencies()
Returns the sum of frequencies of all observed events. |
void |
increment(K key)
Increments the frequency of an event key. |
void |
increment(K key,
int cnt)
Increments the frequency of an event key by cnt. |
int |
remove(K k)
Removes the count of a particular event key. |
int |
set(K key,
int cnt)
Sets the frequency of a particular event key to cnt. |
| Methods inherited from interface java.lang.Iterable |
|---|
iterator |
| Method Detail |
|---|
void increment(K key)
key.
void increment(K key,
int cnt)
key by cnt.
void decrement(K key)
key.
void decrement(K key,
int cnt)
key by cnt.
boolean contains(K key)
int get(K key)
int set(K key,
int cnt)
cnt.
int remove(K k)
key.
void clear()
List<PairOfObjectInt<K>> getFrequencySortedEvents()
List<PairOfObjectInt<K>> getFrequencySortedEvents(int n)
List<PairOfObjectInt<K>> getSortedEvents()
List<PairOfObjectInt<K>> getSortedEvents(int n)
int getNumberOfEvents()
long getSumOfFrequencies()
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||