K1 - first key typeK2 - second key typeV - value typepublic final class HashedBinaryKeyMap<K1,K2,V> extends Object implements BinaryKeyMap<K1,K2,V>
| Constructor and Description |
|---|
HashedBinaryKeyMap()
Create a new empty HashedBinaryKeyMap.
|
HashedBinaryKeyMap(int initialCapacity,
float loadFactor,
int threshold)
Create a new empty HashedBinaryKeyMap with the specified
initial capacity, load factor, and threshold.
|
HashedBinaryKeyMap(Map<? extends BinaryKey<K1,K2>,? extends V> map)
Create a new HashedBinaryKeyMap with the same mappings as
the specified map (copy constructor).
|
| Modifier and Type | Method and Description |
|---|---|
void |
clear()
Clears the map, resetting the size to zero and nullifying references
to avoid garbage collection issues.
|
boolean |
containsKey(K1 key1,
K2 key2)
Return true if this map contains a binary key of {
key1, key2}. |
boolean |
containsKey(Object key)
Checks whether the map contains the specified key.
|
boolean |
containsValue(Object value)
Checks whether the map contains the specified value.
|
Set<Map.Entry<K,V>> |
entrySet()
Gets the entrySet view of the map.
|
boolean |
equals(Object obj)
Compares this map with another.
|
V |
get(K1 key1,
K2 key2)
Return the value mapped to a binary key of {
key1, key2}, if any. |
V |
get(Object key)
Gets the value mapped to the key specified.
|
int |
hashCode()
Gets the standard Map hashCode.
|
boolean |
isEmpty()
Checks whether the map is currently empty.
|
Set<K> |
keySet()
Gets the keySet view of the map.
|
V |
put(BinaryKey<K1,K2> key,
V value)
Puts a key-value mapping into this map.
|
V |
put(K1 key1,
K2 key2,
V value)
Map a binary key of {
key1, key2} to the specified value (optional
operation). |
void |
putAll(Map<? extends K,? extends V> map)
Puts all the values from the specified map into this map.
|
V |
remove(Object key)
Removes the specified mapping from this map.
|
V |
removeKey(K1 key1,
K2 key2)
Remove the mapping for a binary key of {
key1, key2} from this map
if one exists (optional operation). |
int |
size()
Gets the size of the map.
|
String |
toString()
Gets the map as a String.
|
Collection<V> |
values()
Gets the values view of the map.
|
clear, compute, computeIfAbsent, computeIfPresent, containsKey, containsValue, entrySet, equals, forEach, get, getOrDefault, hashCode, isEmpty, keySet, merge, putAll, putIfAbsent, remove, remove, replace, replace, replaceAll, size, valuespublic HashedBinaryKeyMap()
public HashedBinaryKeyMap(int initialCapacity,
float loadFactor,
int threshold)
initialCapacity - initial capacityloadFactor - load factorthreshold - thresholdpublic boolean containsKey(K1 key1, K2 key2)
BinaryKeyMapkey1, key2}.containsKey in interface BinaryKeyMap<K1,K2,V>key1 - first keykey2 - second keykey1, key2}public V get(K1 key1, K2 key2)
BinaryKeyMapkey1, key2}, if any.get in interface BinaryKeyMap<K1,K2,V>key1 - first keykey2 - second keykey1, key2}, or
null if no such mapping existspublic V put(K1 key1, K2 key2, V value)
BinaryKeyMapkey1, key2} to the specified value (optional
operation).put in interface BinaryKeyMap<K1,K2,V>key1 - first keykey2 - second keyvalue - valuekey1, key2},
or null if no such mapping existspublic V removeKey(K1 key1, K2 key2)
BinaryKeyMapkey1, key2} from this map
if one exists (optional operation).removeKey in interface BinaryKeyMap<K1,K2,V>key1 - first keykey2 - second keykey1, key2},
or null if no such mapping existspublic V get(Object key)
public int size()
public boolean isEmpty()
public boolean containsKey(Object key)
containsKey in interface Map<K,V>key - the key to search forpublic boolean containsValue(Object value)
containsValue in interface Map<K,V>value - the value to search forpublic void putAll(Map<? extends K,? extends V> map)
put(Object, Object).putAll in interface Map<K,V>map - the map to addNullPointerException - if the map is nullpublic V remove(Object key)
public void clear()
public Set<Map.Entry<K,V>> entrySet()
public Set<K> keySet()
public Collection<V> values()
public boolean equals(Object obj)
public int hashCode()
Copyright (c) 2007-2016 held jointly by the individual authors. Licensed under the GNU Lesser General Public License (LGPL).