Class AbstractMap<K,V>
java.lang.Object
org.javimmutable.collections.common.AbstractMap<K,V>
- All Implemented Interfaces:
Serializable
,Iterable<IMapEntry<K,
,V>> ICollection<IMapEntry<K,
,V>> IMap<K,
,V> InvariantCheckable
,IStreamable<IMapEntry<K,
,V>> Mapped<K,
,V> SplitableIterable<IMapEntry<K,
V>>
- Direct Known Subclasses:
EmptyHashMap
,HashMap
,OrderedMap
,TreeMap
- See Also:
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionCopies all key-value pairs from the given map.Copies all key-value pairs from the given map.boolean
Return the value associated with key or null if no value is associated.getMap()
Creates an unmodifiable java.util.Map reflecting the values of thisIMap
.int
int
hashCode()
Adds the key/value pair to this map.keys()
Creates an IStreamable to access all of the Map's keys.Returns a map of the same type as this containing all those elements for which predicate returns false.Returns a map of the same type as this containing only those elements for which predicate returns true.toString()
values()
Creates an IStreamable to access all of the Map's values.Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
Methods inherited from interface org.javimmutable.collections.ICollection
isEmpty, isNonEmpty, size
Methods inherited from interface org.javimmutable.collections.IMap
assign, delete, deleteAll, find, findEntry, forEach, forEachThrows, insertAll, insertAll, mapBuilder, mapCollector, reduce, reduceThrows, update
Methods inherited from interface org.javimmutable.collections.InvariantCheckable
checkInvariants
Methods inherited from interface org.javimmutable.collections.IStreamable
iterator, parallelStream, spliterator, stream
Methods inherited from interface org.javimmutable.collections.Mapped
getValueOr
Methods inherited from interface org.javimmutable.collections.SplitableIterable
forEachThrows, indexedForEach, indexedForEachThrows, reduce, reduceThrows
-
Constructor Details
-
AbstractMap
public AbstractMap()
-
-
Method Details
-
get
Description copied from interface:Mapped
Return the value associated with key or null if no value is associated. Note that if null is an acceptable value to the container then this method will be ambiguous and find() should be used instead. -
insert
Adds the key/value pair to this map. Any value already existing for the specified key is replaced with the new value. -
assignAll
Description copied from interface:IMap
Copies all key-value pairs from the given map. The map itself and its keys must be nonnull, but values can be null. If a key already has a value in the map, the old value is replaced with the new value. Returns a newIMap
with the changes. -
assignAll
Description copied from interface:IMap
Copies all key-value pairs from the given map. The map itself and its keys must be nonnull, but values can be null. If a key already has a value in the map, the old value is replaced with the new value. Returns a newIMap
with the changes. -
getMap
Description copied from interface:IMap
Creates an unmodifiable java.util.Map reflecting the values of thisIMap
. -
keys
Description copied from interface:IMap
Creates an IStreamable to access all of the Map's keys. -
values
Description copied from interface:IMap
Creates an IStreamable to access all of the Map's values. -
hashCode
public int hashCode() -
equals
-
toString
-
getSpliteratorCharacteristics
public int getSpliteratorCharacteristics()- Specified by:
getSpliteratorCharacteristics
in interfaceIStreamable<K>
- Returns:
- characteristics value used when creating Spliterators
-
select
Description copied from interface:IMap
Returns a map of the same type as this containing only those elements for which predicate returns true. Implementations are optimized assuming predicate will return false more often than true. -
reject
Description copied from interface:IMap
Returns a map of the same type as this containing all those elements for which predicate returns false. Implementations can be optimized assuming predicate will return false more often than true.
-