public class ObjectIntTreeMap
extends java.util.TreeMap
 This class is NOT thread safe, synchronize read and write 
 operation when used in multi-threaded context if you really need features
 provided by this collection. 
 
 In multithreaded context, it may be wiser to use alternative thread safe and type safe 
 collection such as ConcurrentHashMap<YourType, Integer>.
| Modifier and Type | Class and Description | 
|---|---|
protected static class  | 
ObjectIntTreeMap.GreaterComparator
A Comparator that sort TreeMap of ObjectIntTreeMap by Max Value 
 | 
protected static class  | 
ObjectIntTreeMap.KeyComparator
A Comparator that sort TreeMap of ObjectIntTreeMap by Key Value 
 | 
protected static class  | 
ObjectIntTreeMap.LowerComparator
A Comparator that sort TreeMap of ObjectIntTreeMap by Min Value 
 | 
static class  | 
ObjectIntTreeMap.ObjectComparator
A Comparator that allow ObjectyIntTreeMap to sort multiple kind of Object 
 | 
protected static class  | 
ObjectIntTreeMap.SortedKeyComparator
A Comparator that sort TreeMap of ObjectIntTreeMap by Key Value
 sorted using a sorted List 
 | 
| Modifier and Type | Field and Description | 
|---|---|
static java.lang.String | 
REVISION  | 
| Constructor and Description | 
|---|
ObjectIntTreeMap()
Default convenient constructor 
 | 
ObjectIntTreeMap(java.util.Comparator c)
A constructor working with a comparator 
 | 
ObjectIntTreeMap(ObjectIntTreeMap oitm)
A constructor working with a comparator 
 | 
| Modifier and Type | Method and Description | 
|---|---|
int | 
getAverage()
Return the Average value of the Map or 0 if Map is Empty 
 | 
int | 
getAverage(int level)
Return the Average value of the Map or 0 if Map is Empty 
 | 
int | 
getAverageCount()
Return the Average value of the Map or 0 if Map is Empty 
 | 
int | 
getAverageCount(int level)
Return the Average value of the Map or 0 if Map is Empty 
 | 
int | 
getAverageCount(int level,
               int deep)
Return the Average value of the Map or 0 if Map is Empty 
 | 
int | 
getAverageSum()
This method sum all average at level N-1 
 | 
ObjectIntTreeMap | 
getConsolidatedMap(int level)
This method return an  ObjectIntTreeMap consolidated
 at a given level. 
 | 
protected ObjectIntTreeMap | 
getConsolidatedMap(int level,
                  ObjectIntTreeMap workingMap)  | 
int | 
getCount()
Return the Count value of the Map or Integer.MIN_VALUE if Map is Empty 
 | 
int | 
getCount(int level)
Return the Count value of the Map or 0 if Map is Empty 
 | 
int | 
getCount(int level,
        int boundary)
Return the Count value of the Map or 0 if Map is Empty 
 | 
int | 
getCount(int level,
        int boundary,
        int single)
Return the Count value of the Map or 0 if Map is Empty 
 | 
static java.util.Comparator | 
getGreaterComparator()
Sort ObjectIntTreeMap from larger to smaller 
 | 
int | 
getInt(java.lang.Object key,
      int defaultValue)
Returns the value to which this map maps the specified
 key. 
 | 
static java.util.Comparator | 
getLowerComparator()
Sort ObjectIntTreeMap from smaller to larger 
 | 
int | 
getMax()
Return the Max value of the Map or Integer.MIN_VALUE if Map is Empty 
 | 
int | 
getMax(int level)
Return the Max value of the Map or Integer.MIN_VALUE if Map is Empty 
 | 
int | 
getMaxCount()
Return the Max size value of the Map or Integer.MIN_VALUE if Map is Empty 
 | 
int | 
getMaxCount(int level)
Return the Max value of the Map or Integer.MIN_VALUE if Map is Empty 
 | 
int | 
getMaxCount(int level,
           int deep)
Return the Max size value of the Map or Integer.MIN_VALUE if Map is Empty
 
 Map A > Map B > Map C 
 level: 0  deep : 1 will count min C between A 
 | 
int | 
getMin()
Return the Min value of the Map or Integer.MAX_VALUE if Map is Empty 
 | 
int | 
getMin(int level)
Return the Min value of the Map or Integer.MAX_VALUE if Map is Empty 
 | 
int | 
getMinCount()
Return the Min size value of the Map or Integer.MAX_VALUE if Map is Empty 
 | 
int | 
getMinCount(int level)
Return the Min value of the Map or Integer.MAX_VALUE if Map is Empty 
 | 
int | 
getMinCount(int level,
           int deep)
Return the Min size value of the Map or Integer.MAX_VALUE if Map is Empty 
 | 
static java.util.Comparator | 
getSortedKeyComparator(java.util.List sort)
Sort ObjectIntTreeMap ordered by a predifined List 
 | 
static java.util.Comparator | 
getSortedKeyComparator(java.lang.String[] sort)
Sort ObjectIntTreeMap ordered by a predifined List 
 | 
static java.util.SortedSet | 
getSortedMapEntrySet(java.util.Map map,
                    java.util.Comparator comparator)
This method return a Sorted Set of Map.Entry 
 | 
int | 
getSum()
Return the Sum value of the Map or 0 if Map is Empty 
 | 
int | 
getSum(int level,
      java.util.Set keySet,
      java.util.Map map)
Return the sum of given keys at a given level 
 | 
int | 
getSum(int level,
      java.lang.String key)
Return the sum of a given key at a given level 
 | 
void | 
inc(java.lang.Object key)
Increments the value associated with the specified key. 
 | 
void | 
inc(java.lang.Object key,
   int quantity)
Incremente the value associated with the specified key. 
 | 
void | 
inc(java.lang.String key,
   ObjectIntTreeMap map)
Increments the value associated with the specified key. 
 | 
void | 
incAll(ObjectIntTreeMap map)
Incremente all the values of the specified ObjectIntTreeMap. 
 | 
boolean | 
isMultiMap()
Return true if the ObjectIntTreeMap contains ObjectIntTreeMap
 Return false if the ObjectIntTreeMap contains int[] 
 | 
void | 
put(java.lang.Object key,
   int value)
Associates the specified value with the specified key in this
 map. 
 | 
java.lang.String | 
toString()
Special implementation of toString() 
 | 
ceilingEntry, ceilingKey, clear, clone, comparator, containsKey, containsValue, descendingKeySet, descendingMap, entrySet, firstEntry, firstKey, floorEntry, floorKey, forEach, get, headMap, headMap, higherEntry, higherKey, keySet, lastEntry, lastKey, lowerEntry, lowerKey, navigableKeySet, pollFirstEntry, pollLastEntry, put, putAll, remove, replace, replace, replaceAll, size, subMap, subMap, tailMap, tailMap, valuespublic static final java.lang.String REVISION
public ObjectIntTreeMap()
public ObjectIntTreeMap(java.util.Comparator c)
c - the Comparatorpublic ObjectIntTreeMap(ObjectIntTreeMap oitm)
oitm - the Comparatorpublic void put(java.lang.Object key,
                int value)
key - key with which the specified value is to be associated.value - value to be associated with the specified key.public void inc(java.lang.Object key,
                int quantity)
key - key for which the specified value must be incremented.quantity - the quantity to incrementpublic void incAll(ObjectIntTreeMap map)
map - ObjectIntTreeMap to work withpublic void inc(java.lang.String key,
                ObjectIntTreeMap map)
key - key for which the specified value must be incremented.map - the ObjectIntTreeMap to inc withpublic void inc(java.lang.Object key)
key - key for which the specified value must be incremented.public int getInt(java.lang.Object key,
                  int 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 int getAverage(int level)
level - the max depth of Mapspublic int getAverage()
public int getAverageCount(int level)
level - the max depth of Mapspublic int getAverageCount(int level,
                           int deep)
level - the max depth of Mapsdeep - the level to countpublic int getAverageCount()
public int getCount(int level,
                    int boundary)
level - the count depth of Mapsboundary - the max value to returnpublic int getCount(int level,
                    int boundary,
                    int single)
level - the count depth of Mapsboundary - the max value to returnsingle - the level where to get single content (remove duplicate)public int getCount(int level)
level - the count depth of Mapspublic int getCount()
public int getSum()
public int getSum(int level,
                  java.lang.String key)
level - the working levelkey - the working keypublic int getSum(int level,
                  java.util.Set keySet,
                  java.util.Map map)
level - the working levelkeySet - the working keymap - the working mappublic int getAverageSum()
public int getMax(int level)
level - the max depth of Mapspublic boolean isMultiMap()
public int getMax()
public int getMaxCount(int level)
level - the max depth of Mapspublic int getMaxCount(int level,
                       int deep)
level - the max depth of Mapsdeep - the depth to count onpublic int getMaxCount()
public int getMin(int level)
level - the max depth of Mapspublic int getMin()
public int getMinCount(int level)
level - the max depth of Mapspublic int getMinCount(int level,
                       int deep)
level - public int getMinCount()
public static java.util.SortedSet getSortedMapEntrySet(java.util.Map map,
                                                       java.util.Comparator comparator)
map - a TreeMap that is an ObjectIntTreeMap or composed by ObjectIntTreeMap.comparator - the comparator to sort objects.protected ObjectIntTreeMap getConsolidatedMap(int level, ObjectIntTreeMap workingMap)
level - the map level to consolidateworkingMap - the map to work withgetConsolidatedMap(int)public ObjectIntTreeMap getConsolidatedMap(int level)
level - the map level to consolidatepublic java.lang.String toString()
toString in class java.util.AbstractMappublic static java.util.Comparator getGreaterComparator()
public static java.util.Comparator getLowerComparator()
public static java.util.Comparator getSortedKeyComparator(java.util.List sort)
public static java.util.Comparator getSortedKeyComparator(java.lang.String[] sort)
Copyright © 2001-2018 Jalios SA. All Rights Reserved.