K
- V
- public final class HashPMap<K,V> extends AbstractMap<K,V> implements PMap<K,V>, Serializable
This map uses a given integer map to map hashcodes to lists of elements with the same hashcode. Thus if all elements have the same hashcode, performance is reduced to that of an association list.
This implementation is thread-safe (assuming Java's AbstractMap and AbstractSet are thread-safe), although its iterators may not be.
AbstractMap.SimpleEntry<K,V>, AbstractMap.SimpleImmutableEntry<K,V>
Modifier and Type | Method and Description |
---|---|
boolean |
containsKey(Object key) |
static <K,V> HashPMap<K,V> |
empty(PMap<Integer,PSequence<Map.Entry<K,V>>> intMap) |
Set<Map.Entry<K,V>> |
entrySet() |
V |
get(Object key) |
HashPMap<K,V> |
minus(Object key) |
HashPMap<K,V> |
minusAll(Collection<?> keys) |
HashPMap<K,V> |
plus(K key,
V value) |
HashPMap<K,V> |
plusAll(Map<? extends K,? extends V> map) |
int |
size() |
clear, clone, containsValue, equals, hashCode, isEmpty, keySet, put, putAll, remove, toString, values
finalize, getClass, notify, notifyAll, wait, wait, wait
compute, computeIfAbsent, computeIfPresent, containsValue, equals, forEach, getOrDefault, hashCode, isEmpty, keySet, merge, putIfAbsent, remove, replace, replace, replaceAll, values
public static <K,V> HashPMap<K,V> empty(PMap<Integer,PSequence<Map.Entry<K,V>>> intMap)
K
- V
- intMap
- public int size()
public boolean containsKey(Object key)
containsKey
in interface Map<K,V>
containsKey
in class AbstractMap<K,V>
public HashPMap<K,V> minusAll(Collection<?> keys)
Copyright © 2019. All rights reserved.