Class HashPMap<K,V>
java.lang.Object
java.util.AbstractMap<K,V>
org.pcollections.AbstractUnmodifiableMap<K,V>
org.pcollections.HashPMap<K,V>
- Type Parameters:
K-V-
- All Implemented Interfaces:
Serializable, Map<K,V>, PMap<K, V>
public final class HashPMap<K,V>
extends AbstractUnmodifiableMap<K,V>
implements PMap<K,V>, Serializable
A persistent map from keys to values. Keys and values can be null.
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.
- Author:
- harold
- See Also:
-
Nested Class Summary
Nested classes/interfaces inherited from class AbstractMap
AbstractMap.SimpleEntry<K,V>, AbstractMap.SimpleImmutableEntry<K, V> -
Method Summary
Modifier and TypeMethodDescriptionbooleancontainsKey(Object key) static <K,V> HashPMap <K, V> entrySet()minusAll(Collection<?> keys) / IMPLEMENTED METHODS OF PMap////intsize()/ OVERRIDDEN METHODS FROM AbstractMap ////Methods inherited from class AbstractUnmodifiableMap
clear, compute, computeIfAbsent, computeIfPresent, merge, put, putAll, putIfAbsent, remove, replace, replaceAllMethods inherited from class AbstractMap
clone, containsValue, equals, hashCode, isEmpty, keySet, toString, valuesMethods inherited from interface Map
compute, computeIfAbsent, computeIfPresent, containsValue, equals, forEach, getOrDefault, hashCode, isEmpty, keySet, merge, putIfAbsent, remove, replace, replace, replaceAll, values
-
Method Details
-
empty
-
entrySet
-
size
-
containsKey
- Specified by:
containsKeyin interfaceMap<K,V> - Overrides:
containsKeyin classAbstractMap<K,V>
-
get
-
plusAll
-
minusAll
-
plus
-
minus
-