Java Utililty Methods HashMap Create

List of utility methods to do HashMap Create

Description

The list of methods to do HashMap Create are organized into topic(s).

Method

java.util.HashMapgetHashMap()
Return a basic HashMap
return new HashMap<T, S>(0);
HashMapgetHashMap()
get Hash Map
Runtime runtime = Runtime.getRuntime();
HashMap<String, Long> params = new HashMap<String, Long>();
params.put("Used", runtime.totalMemory() - runtime.freeMemory());
params.put("Free", runtime.freeMemory());
params.put("Total", runtime.totalMemory());
params.put("Max", runtime.maxMemory());
return params;
HashMapgetHashMap()
get Hash Map
return new HashMap<String, String>();
HashMapgetHashMap(Object... args)
get Hash Map
assert (args.length % 2 == 0);
HashMap<K, V> map = new HashMap<>();
for (int i = 0; i < args.length; i += 2) {
    map.put((K) args[i], (V) args[i + 1]);
return map;
HashMapgetHashMapFromArrayList(ArrayList lines, int keyIndex)
get Hash Map From Array List
HashMap<String, String> map = new HashMap<String, String>();
for (String line : lines) {
    String key = line.split(",")[keyIndex];
    map.put(key, line);
return map;
MapgetHashMapFromMap(Map map, K key)
get Hash Map From Map
Map<A, B> value = map.get(key);
if (value == null) {
    value = new HashMap<>();
    map.put(key, (V) value);
return value;
HashMaphashMap()
hash Map
return new HashMap<K, V>();
MaphashMap()
Creates a HashMap instance.
return new HashMap<K, V>();
HashMaphashmap()
hashmap
return new HashMap<K, V>();
MaphashMap(Entry... entries)
hash Map
return hashMap(Arrays.asList(entries));