Class OrderedPMap<K,V>
java.lang.Object
java.util.AbstractMap<K,V>
org.pcollections.AbstractUnmodifiableMap<K,V>
org.pcollections.OrderedPMap<K,V>
- Type Parameters:
K-V-
- All Implemented Interfaces:
Serializable, Map<K,V>, PMap<K, V>
public class OrderedPMap<K,V>
extends AbstractUnmodifiableMap<K,V>
implements PMap<K,V>, Serializable
Like
PMap but preserves insertion order. Persistent equivalent of LinkedHashMap.
Note that, like LinkedHashMap, insertion order is not affected if a key is re-inserted
into the map.
(Note: this is different from PSortedMap, which keeps elements in the order specified
by Comparable.compareTo(Object) or Comparator.compare(Object, Object).)
- 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> OrderedPMap <K, V> empty()entrySet()static <K,V> OrderedPMap <K, V> minusAll(Collection<?> keys) static <K,V> OrderedPMap <K, V> singleton(K k, V v) intsize()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
-
from
-
singleton
-
get
-
containsKey
- Specified by:
containsKeyin interfaceMap<K,V> - Overrides:
containsKeyin classAbstractMap<K,V>
-
plus
-
plusAll
-
minus
-
minusAll
-
entrySet
-
size
-