public class PersistentHashMap<K,V> extends AbstractUnmodMap<K,V> implements ImMap<K,V>, Serializable
| Modifier and Type | Class and Description |
|---|---|
static class |
PersistentHashMap.MutableHashMap<K,V> |
UnmodMap.UnEntry<K,V>| Modifier and Type | Field and Description |
|---|---|
static PersistentHashMap<Object,Object> |
EMPTY |
| Modifier and Type | Method and Description |
|---|---|
PersistentHashMap<K,V> |
assoc(K key,
V val)
Returns a new map with the given key/value added
|
static <K,V> PersistentHashMap<K,V> |
empty() |
static <K,V> PersistentHashMap<K,V> |
empty(Equator<K> e) |
static <K,V> PersistentHashMap.MutableHashMap<K,V> |
emptyMutable()
Works around some type inference limitations of Java 8.
|
static <K,V> PersistentHashMap.MutableHashMap<K,V> |
emptyMutable(Equator<K> e)
Works around some type inference limitations of Java 8.
|
Option<UnmodMap.UnEntry<K,V>> |
entry(K key)
Returns an option of the key/value pair associated with this key
|
Equator<K> |
equator()
Returns the Equator used by this map for equals comparisons and hashCodes
|
UnmodIterator<UnmodMap.UnEntry<K,V>> |
iterator()
A one-time use, mutable, not-thread-safe way to get each value of the underling collection in
turn.
|
UnmodIterator<K> |
keyIterator() |
PersistentHashMap.MutableHashMap<K,V> |
mutable()
Returns a mutable version of this mutable map.
|
static <K,V> PersistentHashMap<K,V> |
of(Iterable<Map.Entry<K,V>> kvPairs)
Returns a new PersistentHashMap of the given keys and their paired values.
|
static <K,V> PersistentHashMap<K,V> |
ofEq(Equator<K> eq,
Iterable<Map.Entry<K,V>> es)
Returns a new PersistentHashMap of the given keys and their paired values, skipping any null
Entries.
|
int |
size()
Returns the number of items in this collection or iterable.
|
UnmodIterator<V> |
valIterator() |
PersistentHashMap<K,V> |
without(K key)
Returns a new map with the given key/value removed
|
equalshashCode, toStringclone, finalize, getClass, notify, notifyAll, wait, wait, waitcontainsKey, get, getOrElseclear, compute, computeIfAbsent, computeIfPresent, containsValue, isEmpty, merge, put, putAll, putIfAbsent, remove, remove, replace, replace, replaceAll, valuesequals, forEach, getOrDefault, hashCodeconcat, drop, dropWhile, filter, flatMap, fold, foldUntil, hash, head, map, precat, take, takeWhile, toStringforEach, spliteratortoImList, toImMap, toImRrbt, toImSet, toImSortedMap, toImSortedSet, toMutableList, toMutableMap, toMutableRrbt, toMutableSet, toMutableSortedMap, toMutableSortedSetpublic static final PersistentHashMap<Object,Object> EMPTY
public static <K,V> PersistentHashMap<K,V> empty()
public static <K,V> PersistentHashMap.MutableHashMap<K,V> emptyMutable()
public static <K,V> PersistentHashMap<K,V> empty(Equator<K> e)
public static <K,V> PersistentHashMap.MutableHashMap<K,V> emptyMutable(Equator<K> e)
public static <K,V> PersistentHashMap<K,V> ofEq(Equator<K> eq, Iterable<Map.Entry<K,V>> es)
public static <K,V> PersistentHashMap<K,V> of(Iterable<Map.Entry<K,V>> kvPairs)
StaticImports.map(Map.Entry...). Use
the StaticImports.tup(Object, Object) method to define key/value
pairs briefly and easily.kvPairs - Key/value pairs (to go into the map). In the case of a duplicate key, later
values in the input list overwrite the earlier ones. The resulting map can contain zero or one
null key and any number of null values. Null k/v pairs will be silently ignored.public Equator<K> equator()
equator in interface BaseUnsortedMap<K,V>public PersistentHashMap<K,V> assoc(K key, V val)
ImMappublic PersistentHashMap.MutableHashMap<K,V> mutable()
ImMappublic Option<UnmodMap.UnEntry<K,V>> entry(K key)
BaseMappublic UnmodIterator<UnmodMap.UnEntry<K,V>> iterator()
UnmodIterableiterator in interface Iterable<UnmodMap.UnEntry<K,V>>iterator in interface UnmodIterable<UnmodMap.UnEntry<K,V>>public UnmodIterator<K> keyIterator()
keyIterator in interface UnmodMap<K,V>public UnmodIterator<V> valIterator()
valIterator in interface UnmodMap<K,V>public int size()
Copyright © 2019. All rights reserved.