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> -
Field Summary
FieldsModifier and TypeFieldDescriptionprivate static final OrderedPMap<Object, Object> private final PSortedMap<Long, Map.Entry<K, V>> private static final long -
Constructor Summary
ConstructorsModifierConstructorDescriptionprivateOrderedPMap(PMap<K, Long> ids, PSortedMap<Long, Map.Entry<K, V>> entries) -
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
-
Field Details
-
serialVersionUID
private static final long serialVersionUID- See Also:
-
EMPTY
-
ids
-
entries
-
-
Constructor Details
-
OrderedPMap
-
-
Method Details
-
empty
-
from
-
singleton
-
get
-
containsKey
- Specified by:
containsKeyin interfaceMap<K,V> - Overrides:
containsKeyin classAbstractMap<K,V>
-
plus
-
plusAll
-
minus
-
minusAll
-
entrySet
-
size
-