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 java.util.AbstractMap
AbstractMap.SimpleEntry<K,
V>, AbstractMap.SimpleImmutableEntry<K, V> -
Field Summary
FieldsModifier and TypeFieldDescriptionprivate static final OrderedPMap
<Object, Object> private final PSortedMap
<Long, Map.Entry<K, V>> private static final long
-
Constructor Summary
ConstructorsModifierConstructorDescriptionprivate
OrderedPMap
(PMap<K, Long> ids, PSortedMap<Long, Map.Entry<K, V>> entries) -
Method Summary
Modifier and TypeMethodDescriptionstatic <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) int
size()
Methods inherited from class org.pcollections.AbstractUnmodifiableMap
clear, compute, computeIfAbsent, computeIfPresent, merge, put, putAll, putIfAbsent, remove, replace, replaceAll
Methods inherited from class java.util.AbstractMap
clone, containsKey, containsValue, equals, hashCode, isEmpty, keySet, toString, values
Methods inherited from class java.lang.Object
finalize, getClass, notify, notifyAll, wait, wait, wait
Methods inherited from interface java.util.Map
compute, computeIfAbsent, computeIfPresent, containsKey, containsValue, equals, forEach, getOrDefault, hashCode, isEmpty, keySet, merge, putIfAbsent, remove, replace, replace, replaceAll, values
-
Field Details
-
serialVersionUID
private static final long serialVersionUID- See Also:
-
EMPTY
-
ids
-
entries
-
-
Constructor Details
-
OrderedPMap
-
-
Method Details
-
empty
-
from
-
singleton
-
get
-
plus
-
plusAll
-
minus
-
minusAll
-
entrySet
-
size
public int size()
-