List of utility methods to do HashMap Create
HashMap | createHashMap() Creates a mutable, empty HashMap instance. return new HashMap<K, V>(); |
HashMap | createHashMap() create Hash Map return new HashMap<K, V>(); |
Map | createHashMap(int expectedMapSize) Utility method that creates an java.util.HashMap with its initialCapacity calculated to minimize rehash operations int initialCapacity = (int) (expectedMapSize / HASHMAP_DEFAULT_LOAD_FACTOR) + 1; return new HashMap<K, V>(initialCapacity); |
HashMap | createHashMap(int initialCapacity) create Hash Map return new HashMap<K, V>(initialCapacity); |
Map | createHashMap(int initialCapacity) Returns a hash map typed to the generics specified in the method call with the given initial capacity return new HashMap<K, V>(initialCapacity); |
Map | createHashMap(int size) Creates the hash map instance that will hold the given amount of elements. return new HashMap<K, V>((int) (size * 1.1), 0.95f); |
Map | createHashMap(Object key, Object value) create Hash Map Map<Object, Object> map = new HashMap<Object, Object>(); map.put(key, value); return map; |
Map | createHashMapIfNull(Map create Hash Map If Null if (map == null) { map = new HashMap<K, V>(); return map; |
HashMap | createHashMapWithSize(final int size) Creates a new HashMap with the given expected size. final int initialCapacity = (int) Math.ceil(size / DEFAULT_LOAD_FACTOR); return new HashMap<KeyType, ValueType>(initialCapacity, DEFAULT_LOAD_FACTOR); |
Map | getHashMap() get Hash Map return new HashMap<K, V>(); |