Constructor and Description |
---|
TallyMapLong() |
Modifier and Type | Method and Description |
---|---|
long |
dec(K key)
Decrement the count associated with the specified key by 1.
|
long |
dec(K key,
long amount)
Decrement the count associated with the specified key by the given
amount.
|
long |
get(K key)
Returns the count associated with the specified key.
|
K |
getHighestKey()
Returns the key that is "highest" in the natural ordering of
the K class, and is also present (has a non-zero count) in the map.
|
Set<K> |
getKeys()
Returns the key set for the backing map.
|
long |
getTotal()
Returns the sum of all values in the map; i.e. the Grand Total.
|
long |
inc(K key)
Increment the count associated with the specified key by 1.
|
long |
inc(K key,
long amount)
Increment the count associated with the specified key by the given
amount.
|
String |
toString() |
public long inc(K key)
key
- the keypublic long inc(K key, long amount)
key
- the keyamount
- the amount to increment bypublic long dec(K key)
key
- the keypublic long dec(K key, long amount)
key
- the keyamount
- the amount to decrement bypublic long get(K key)
key
- the keypublic Set<K> getKeys()
public long getTotal()
public K getHighestKey()
Copyright © 2015. All Rights Reserved.