public class Histotable<K> extends TreeMap<K,Long>
AbstractMap.SimpleEntry<K,V>, AbstractMap.SimpleImmutableEntry<K,V>
Constructor and Description |
---|
Histotable() |
Modifier and Type | Method and Description |
---|---|
long |
add(Histotable<K> ht) |
static String |
entryString(Object e)
Utility method to convert a key->Long into
the string "count key".
|
Long |
get(Object key)
Return 0 instead of null for absent keys.
|
static TreeSet<Map.Entry<?,Long>> |
getEntryByFrequencySortedSet()
Get a SortedSet that, when filled with (String key)->(long count)
Entry instances, sorts them by (count, key) descending, as is useful
for most-frequent displays.
|
long |
getLargestValue()
Return the largest value of any key that is larger than 0.
|
TreeSet<Map.Entry<?,Long>> |
getSortedByCounts() |
Set<Map.Entry<K,Long>> |
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.
|
ceilingEntry, ceilingKey, clear, clone, comparator, containsKey, containsValue, descendingKeySet, descendingMap, entrySet, firstEntry, firstKey, floorEntry, floorKey, headMap, headMap, higherEntry, higherKey, keySet, lastEntry, lastKey, lowerEntry, lowerKey, navigableKeySet, pollFirstEntry, pollLastEntry, put, putAll, remove, size, subMap, subMap, tailMap, tailMap, values
equals, hashCode, isEmpty, toString
public void tally(K key)
key
- Object key.public void tally(K key, long count)
key
- Object key.public static TreeSet<Map.Entry<?,Long>> getEntryByFrequencySortedSet()
public TreeSet<Map.Entry<?,Long>> getSortedByCounts()
public Set<Map.Entry<K,Long>> getSortedByKeys()
public long getLargestValue()
public long getTotal()
public static String entryString(Object e)
e
- Map key.public long add(Histotable<K> ht)
public long subtract(Histotable<K> ht)
Copyright © 2003-2014 Internet Archive. All Rights Reserved.