Package org.organicdesign.fp.collections
Interface ImMap<K,V>
-
- All Superinterfaces:
BaseMap<K,V>,BaseUnsortedMap<K,V>,java.lang.Iterable<UnmodMap.UnEntry<K,V>>,java.util.Map<K,V>,Sized,Transformable<UnmodMap.UnEntry<K,V>>,UnmodIterable<UnmodMap.UnEntry<K,V>>,UnmodMap<K,V>
- All Known Implementing Classes:
PersistentHashMap
public interface ImMap<K,V> extends BaseUnsortedMap<K,V>
An immutable map with no guarantees about its ordering.
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from interface java.util.Map
java.util.Map.Entry<K extends java.lang.Object,V extends java.lang.Object>
-
Nested classes/interfaces inherited from interface org.organicdesign.fp.collections.UnmodMap
UnmodMap.UnEntry<K,V>
-
-
Method Summary
All Methods Instance Methods Abstract Methods Default Methods Modifier and Type Method Description default ImMap<K,V>assoc(java.util.Map.Entry<K,V> entry)Returns a new map with an immutable copy of the given entry addedImMap<K,V>assoc(K key, V val)Returns a new map with the given key/value addeddefault ImSet<java.util.Map.Entry<K,V>>entrySet()Returns a view of the mappings contained in this map.default ImSet<K>keySet()Returns an immutable view of the keys contained in this map.MutableMap<K,V>mutable()Returns a mutable version of this mutable map.ImMap<K,V>without(K key)Returns a new map with the given key/value removed-
Methods inherited from interface org.organicdesign.fp.collections.BaseMap
containsKey, entry, get, getOrElse
-
Methods inherited from interface org.organicdesign.fp.collections.BaseUnsortedMap
equator
-
Methods inherited from interface org.organicdesign.fp.xform.Transformable
toImList, toImMap, toImRrbt, toImSet, toImSortedMap, toImSortedSet, toMutableList, toMutableMap, toMutableRrbt, toMutableSet, toMutableSortedMap, toMutableSortedSet
-
Methods inherited from interface org.organicdesign.fp.collections.UnmodIterable
concat, drop, dropWhile, filter, flatMap, fold, foldUntil, head, iterator, map, precat, take, takeWhile
-
Methods inherited from interface org.organicdesign.fp.collections.UnmodMap
clear, compute, computeIfAbsent, computeIfPresent, containsValue, isEmpty, keyIterator, merge, put, putAll, putIfAbsent, remove, remove, replace, replace, replaceAll, valIterator, values
-
-
-
-
Method Detail
-
assoc
default ImMap<K,V> assoc(java.util.Map.Entry<K,V> entry)
Returns a new map with an immutable copy of the given entry added
-
entrySet
default ImSet<java.util.Map.Entry<K,V>> entrySet()
Returns a view of the mappings contained in this map. The set should actually contain UnmodMap.Entry items, but that return signature is illegal in Java, so you'll just have to remember.
-
mutable
MutableMap<K,V> mutable()
Returns a mutable version of this mutable map.
-
-