|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectjava.util.AbstractMap<K,V>
java.util.HashMap<K,java.lang.Long>
org.archive.util.Histotable<K>
public class Histotable<K>
Collect and report frequency information. Assumes external synchornization.
| Constructor Summary | |
|---|---|
Histotable()
|
|
| Method Summary | |
|---|---|
long |
add(Histotable<K> ht)
|
static java.lang.String |
entryString(java.lang.Object e)
Utility method to convert a key->Long into the string "count key". |
long |
getLargestValue()
Return the largest value of any key that is larger than 0. |
java.util.TreeSet |
getSortedByCounts()
|
java.util.TreeSet |
getSortedByKeys()
|
long |
getTotal()
Return the total of all tallies. |
long |
subtract(Histotable<K> ht)
|
void |
tally(K key)
Record one more occurence of the given object key. |
void |
tally(K key,
long count)
Record count more occurence(s) of the given object key. |
| 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 |
| Constructor Detail |
|---|
public Histotable()
| Method Detail |
|---|
public void tally(K key)
key - Object key.
public void tally(K key,
long count)
key - Object key.public java.util.TreeSet getSortedByCounts()
public java.util.TreeSet getSortedByKeys()
public long getLargestValue()
public long getTotal()
public static java.lang.String entryString(java.lang.Object e)
e - Map key.
public long add(Histotable<K> ht)
public long subtract(Histotable<K> ht)
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||