org.apache.myfaces.shared_tomahawk.util
Class HashMapUtils
java.lang.Object
   org.apache.myfaces.shared_tomahawk.util.HashMapUtils
org.apache.myfaces.shared_tomahawk.util.HashMapUtils
- public class HashMapUtils 
- extends Object
- Version:
- $Revision: 557350 $ $Date: 2007-07-18 13:19:50 -0500 (Wed, 18 Jul 2007) $
- Author:
- Anton Koinov (latest modification by $Author: matzew $)
 
| Method Summary | 
| static int | calcCapacity(int size)Calculates initial capacity needed to hold
 sizeelements in
 a HashMap or Hashtable without forcing an expensive increase in internal
 capacity. | 
| static String | mapToString(Map map)spit out each name/value pair
 | 
| static HashMap | merge(Map map1,
      Map map2)Creates a new
 HashMapthat has all of the elements
 ofmap1andmap2(on key collision, the latter
 override the former). | 
 
| Methods inherited from class java.lang.Object | 
| clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait | 
 
HashMapUtils
protected HashMapUtils()
calcCapacity
public static final int calcCapacity(int size)
- Calculates initial capacity needed to hold sizeelements 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
 
merge
public static HashMap merge(Map map1,
                            Map map2)
- Creates a new HashMapthat 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
 
mapToString
public static String mapToString(Map map)
- spit out each name/value pair
 
- 
 
Copyright © 2012 The Apache Software Foundation. All Rights Reserved.