K1
- first key typeK2
- second key typeK3
- third key typeV
- value typepublic final class HashedTernaryKeyMap<K1,K2,K3,V> extends Object implements TernaryKeyMap<K1,K2,K3,V>
Constructor and Description |
---|
HashedTernaryKeyMap()
Create a new empty HashedTernaryKeyMap.
|
HashedTernaryKeyMap(int initialCapacity,
float loadFactor,
int threshold)
Create a new empty HashedTernaryKeyMap with the specified
initial capacity, load factor, and threshold.
|
HashedTernaryKeyMap(Map<? extends TernaryKey<K1,K2,K3>,? extends V> map)
Create a new HashedTernaryKeyMap 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,
K3 key3)
Return true if this map contains a ternary key of {
key1, key2, key3 }. |
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,
K3 key3)
Return the value mapped to a ternary key of {
key1, key2, key3 }, 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(K1 key1,
K2 key2,
K3 key3,
V value)
Map a ternary key of {
key1, key2, key3 } to the specified value
(optional operation). |
V |
put(TernaryKey<K1,K2,K3> key,
V value)
Puts a key-value mapping into this map.
|
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,
K3 key3)
Remove the mapping for a ternary key of {
key1, key2, key3 } 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, values
public HashedTernaryKeyMap()
public HashedTernaryKeyMap(int initialCapacity, float loadFactor, int threshold)
initialCapacity
- initial capacityloadFactor
- load factorthreshold
- thresholdpublic boolean containsKey(K1 key1, K2 key2, K3 key3)
TernaryKeyMap
key1, key2, key3
}.containsKey
in interface TernaryKeyMap<K1,K2,K3,V>
key1
- first keykey2
- second keykey3
- third keykey1, key2, key3
}public V get(K1 key1, K2 key2, K3 key3)
TernaryKeyMap
key1, key2, key3
}, if any.public V put(K1 key1, K2 key2, K3 key3, V value)
TernaryKeyMap
key1, key2, key3
} to the specified value
(optional operation).public V removeKey(K1 key1, K2 key2, K3 key3)
TernaryKeyMap
key1, key2, key3
} from this map
if one exists (optional operation).public 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).