|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object java.util.AbstractMap<K,V> java.util.TreeMap com.jalios.util.ObjectLongTreeMap
public class ObjectLongTreeMap
This class is a map which binds key Object to long value.
Nested Class Summary | |
---|---|
static class |
ObjectLongTreeMap.GreaterComparator
A Comparator that sort TreeMap of ObjectLongTreeMap by Max Value |
protected static class |
ObjectLongTreeMap.KeyComparator
A Comparator that sort TreeMap of ObjectLongTreeMap by Key Value |
static class |
ObjectLongTreeMap.LowerComparator
A Comparator that sort TreeMap of ObjectLongTreeMap by Min Value |
static class |
ObjectLongTreeMap.ObjectComparator
A Comparator that allow ObjectyLongTreeMap to sort multiple kind of Object |
static class |
ObjectLongTreeMap.SortedKeyComparator
A Comparator that sort TreeMap of ObjectLongTreeMap by Key Value sorted using a sorted List |
Nested classes/interfaces inherited from class java.util.AbstractMap |
---|
AbstractMap.SimpleEntry<K,V>, AbstractMap.SimpleImmutableEntry<K,V> |
Field Summary | |
---|---|
static String |
REVISION
|
Constructor Summary | |
---|---|
ObjectLongTreeMap()
|
Method Summary | |
---|---|
static Comparator |
getGreaterComparator()
Sort ObjectLongTreeMap from larger to smaller |
long |
getLong(Object key,
long defaultValue)
Returns the value to which this map maps the specified key. |
static Comparator |
getLowerComparator()
Sort ObjectLongTreeMap from smaller to larger |
static Comparator |
getSortedKeyComparator(List sort)
Sort ObjectLongTreeMap ordered by a predifined List |
static Comparator |
getSortedKeyComparator(String[] sort)
Sort ObjectLongTreeMap ordered by a predifined List |
static SortedSet |
getSortedMapEntrySet(Map map,
Comparator comparator)
This method return a Sorted Set of Map.Entry |
long |
getSum()
Returns the sum of the values of the map |
void |
inc(Object key)
Incremente the value associated with the specified key. |
void |
inc(Object key,
long quantity)
Incremente the value associated with the specified key. |
void |
put(Object key,
long value)
Associates the specified value with the specified key in this map. |
Methods inherited from class java.util.TreeMap |
---|
ceilingEntry, ceilingKey, clear, clone, comparator, containsKey, containsValue, descendingKeySet, descendingMap, entrySet, firstEntry, firstKey, floorEntry, floorKey, get, headMap, headMap, higherEntry, higherKey, keySet, lastEntry, lastKey, lowerEntry, lowerKey, navigableKeySet, pollFirstEntry, pollLastEntry, put, putAll, remove, size, subMap, subMap, tailMap, tailMap, values |
Methods inherited from class java.util.AbstractMap |
---|
equals, hashCode, isEmpty, toString |
Methods inherited from class java.lang.Object |
---|
finalize, getClass, notify, notifyAll, wait, wait, wait |
Methods inherited from interface java.util.Map |
---|
equals, hashCode, isEmpty |
Field Detail |
---|
public static final String REVISION
Constructor Detail |
---|
public ObjectLongTreeMap()
Method Detail |
---|
public void put(Object key, long value)
key
- key with which the specified value is to be associated.value
- value to be associated with the specified key.public void inc(Object key, long quantity)
key
- key for which the specified value must be incremented.quantity
- the quantity to incrementpublic void inc(Object key)
key
- key for which the specified value must be incremented.public long getLong(Object key, long defaultValue)
defaultValue
if the map contains no
mapping for this key.
key
- key whose associated value is to be returned.defaultValue
- value to return if the map contains no mapping for this key.
defaultValue
if the map contains no mapping for this key.public long getSum()
public static SortedSet getSortedMapEntrySet(Map map, Comparator comparator)
map
- a TreeMap that is an ObjectLongTreeMap or composed by ObjectLongTreeMap.comparator
- the comparator to sort objects.
public static Comparator getGreaterComparator()
public static Comparator getLowerComparator()
public static Comparator getSortedKeyComparator(List sort)
public static Comparator getSortedKeyComparator(String[] sort)
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |