|
||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||
java.lang.Objectjava.util.AbstractMap
java.util.HashMap
de.pado.dv.FrequencyList
public class FrequencyList
This class models a hash map whose keys are Strings, and values are Doubles to keep track of frequency counts. The hash table can be kept at constant size by removing the most infrequent entries.
| Method Summary | |
|---|---|
java.util.List |
entriesByFrequency()
Returns a list representation of the entries in the FrequencyList, sorted according to inverse frequency (largest first). |
java.util.List |
entriesNatural()
Returns a list representation of the entries in the FrequencyList, sorted according to the keys. |
void |
inc(java.lang.Object o,
java.lang.Double increment)
Increase the frequency count for o by increment. |
void |
purge(int maxsize,
double ratio)
Reduces the FrequencyList to size maxsize if its size is larger than maxsize/ratio. |
void |
resetFrequencies()
Set all frequencies to zero |
java.lang.String |
toStringByFrequency()
Returns a string representation of the FrequencyList, sorted inversely according to the values (greatest frequency first). |
java.lang.String |
toStringNatural()
Returns a string representation of the FrequencyList, sorted according to keys. |
| Methods inherited from class java.util.HashMap |
|---|
clear, clone, containsKey, containsValue, entrySet, get, isEmpty, keySet, put, putAll, remove, size, values |
| Methods inherited from class java.util.AbstractMap |
|---|
equals, hashCode, toString |
| Methods inherited from class java.lang.Object |
|---|
finalize, getClass, notify, notifyAll, wait, wait, wait |
| Methods inherited from interface java.util.Map |
|---|
equals, hashCode |
| Method Detail |
|---|
public void inc(java.lang.Object o,
java.lang.Double increment)
public void purge(int maxsize,
double ratio)
throws java.io.IOException
java.io.IOExceptionpublic java.util.List entriesByFrequency()
public java.util.List entriesNatural()
public java.lang.String toStringByFrequency()
public java.lang.String toStringNatural()
public void resetFrequencies()
|
||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||