| Constructor and Description |
|---|
SpaceEfficientHashMap() |
SpaceEfficientHashMap(Map<? extends K,? extends V> m)
Constructs a new HashMap with the same mappings as the
specified Map.
|
| Modifier and Type | Method and Description |
|---|---|
void |
clear() |
boolean |
containsKey(Object key) |
boolean |
containsValue(Object value) |
Set<Map.Entry<K,V>> |
entrySet() |
boolean |
equals(Object o)
Compares the specified object with this map for equality.
|
V |
get(Object key) |
int |
hashCode()
Returns the hash code value for this map.
|
boolean |
isEmpty() |
Set<K> |
keySet() |
V |
put(K key,
V value) |
void |
putAll(Map<? extends K,? extends V> m) |
V |
remove(Object key) |
int |
size() |
String |
toString() |
void |
trimToSize() |
Collection<V> |
values() |
clone, finalize, getClass, notify, notifyAll, wait, wait, waitcompute, computeIfAbsent, computeIfPresent, forEach, getOrDefault, merge, putIfAbsent, remove, replace, replace, replaceAllpublic SpaceEfficientHashMap()
public SpaceEfficientHashMap(Map<? extends K,? extends V> m)
m - the map whose mappings are to be placed in this mapNullPointerException - if the specified map is nullpublic boolean containsKey(Object key)
containsKey in interface Map<K,V>public boolean containsValue(Object value)
containsValue in interface Map<K,V>public boolean equals(Object o)
This implementation first checks if the specified object is this map; if so it returns true. Then, it checks if the specified object is a map whose size is identical to the size of this map; if not, it returns false. If so, it iterates over this map's entrySet collection, and checks that the specified map contains each mapping that this map contains. If the specified map fails to contain such a mapping, false is returned. If the iteration completes, true is returned.
public int hashCode()
Object.hashCode().
This implementation iterates over entrySet(), calling
hashCode() on each element (entry) in the
set, and adding up the results.
hashCode in interface Map<K,V>hashCode in class ObjectMap.Entry#hashCode(),
Object.equals(Object),
Set.equals(Object)public void trimToSize()
Copyright © 2018. All rights reserved.