Package org.organicdesign.fp.collections
Interface BaseMap<K,V>
-
- All Superinterfaces:
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 Subinterfaces:
BaseUnsortedMap<K,V>,ImMap<K,V>,ImSortedMap<K,V>,MutableMap<K,V>
- All Known Implementing Classes:
PersistentHashMap,PersistentHashMap.MutableHashMap,PersistentTreeMap
public interface BaseMap<K,V> extends UnmodMap<K,V>
Adds copy-on-write, "fluent interface" methods toUnmodMap. Lowest common ancestor ofBaseUnsortedMap, andImSortedMap.
-
-
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 BaseMap<K,V>assoc(java.util.Map.Entry<K,V> entry)Returns a new map with an immutable copy of the given entry addedBaseMap<K,V>assoc(K key, V val)Returns a new map with the given key/value addeddefault booleancontainsKey(java.lang.Object key)Option<UnmodMap.UnEntry<K,V>>entry(K key)Returns an option of the key/value pair associated with this keyBaseSet<java.util.Map.Entry<K,V>>entrySet()Returns a view of the mappings contained in this map.default Vget(java.lang.Object key)default VgetOrElse(K key, V notFound)BaseSet<K>keySet()Returns a view of the keys contained in this map.BaseMap<K,V>without(K key)Returns a new map with the given key/value removed-
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
-
entry
Option<UnmodMap.UnEntry<K,V>> entry(K key)
Returns an option of the key/value pair associated with this key
-
assoc
default BaseMap<K,V> assoc(java.util.Map.Entry<K,V> entry)
Returns a new map with an immutable copy of the given entry added
-
entrySet
BaseSet<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.
-
containsKey
default boolean containsKey(java.lang.Object key)
-
-