|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectnl.lxtreme.ols.util.analysis.Frequency<TYPE>
public final class Frequency<TYPE extends Comparable<TYPE>>
Provides a frequency distribution.
Constructor Summary | |
---|---|
Frequency()
Creates a new Frequency instance. |
|
Frequency(Comparator<TYPE> aComparator)
Creates a new Frequency instance using the given comparator for sorting the added values. |
Method Summary | |
---|---|
void |
addValue(TYPE aValue)
Adds a given value to the distribution map. |
void |
clear()
Clears all values from this frequency distribution. |
long |
getCount(TYPE aValue)
Counts the number of occurrences of the given value. |
TYPE |
getHighestRanked()
Returns the item with the highest count or rank. |
TYPE |
getLowestRanked()
Returns the item with the lowest count or rank. |
long |
getTotalCount()
Returns the number of entries in this frequency distribution map. |
int |
getUniqueValueCount()
Returns the number of unique values in this frequency distribution map. |
Iterable<TYPE> |
values()
Returns an iterator for the values in this frequency distribution map. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public Frequency()
public Frequency(Comparator<TYPE> aComparator)
aComparator
- the comparator to use for the distribution map, cannot be
null
.
IllegalArgumentException
- in case the given comparator was null
.Method Detail |
---|
public void addValue(TYPE aValue)
aValue
- the value to add, cannot be null
.
IllegalArgumentException
- in case the given value was null
.public void clear()
public long getCount(TYPE aValue)
aValue
- the value to count, cannot be null
.
IllegalArgumentException
- in case the given value was null
.public TYPE getHighestRanked()
null
if this
frequency distribution is empty.public TYPE getLowestRanked()
null
if this
frequency distribution is empty.public long getTotalCount()
public int getUniqueValueCount()
public Iterable<TYPE> values()
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |