Package org.apache.myfaces.util.lang
Class HashMapUtils
java.lang.Object
org.apache.myfaces.util.lang.HashMapUtils
- 
Constructor SummaryConstructors
- 
Method SummaryModifier and TypeMethodDescriptionstatic final intcalcCapacity(int size) Calculates initial capacity needed to holdsizeelements in a HashMap or Hashtable without forcing an expensive increase in internal capacity.static StringmapToString(Map map) spit out each name/value pairstatic HashMapCreates a newHashMapthat has all of the elements ofmap1andmap2(on key collision, the latter override the former).
- 
Constructor Details- 
HashMapUtilsprotected HashMapUtils()
 
- 
- 
Method Details- 
calcCapacitypublic static final int calcCapacity(int size) Calculates initial capacity needed to holdsizeelements in a HashMap or Hashtable without forcing an expensive increase in internal capacity. Capacity is based on the default load factor of .75.Usage: Map map = new HashMap(HashMapUtils.calcCapacity(10));- Parameters:
- size- the number of items that will be put into a HashMap
- Returns:
- initial capacity needed
 
- 
mergeCreates a newHashMapthat has all of the elements ofmap1andmap2(on key collision, the latter override the former).- Parameters:
- map1- the fist hashmap to merge
- map2- the second hashmap to merge
- Returns:
- new hashmap
 
- 
mapToStringspit out each name/value pair
 
-