Module org.jhotdraw8.icollection
Interface ImmutableSortedMap<K,V>
- Type Parameters:
K- the key typeV- the value type
- All Superinterfaces:
ImmutableMap<K,,V> Iterable<Map.Entry<K,,V>> ReadOnlyMap<K,,V> ReadOnlySequencedMap<K,,V> ReadOnlySortedMap<K,V>
- All Known Subinterfaces:
ImmutableNavigableMap<K,V>
- All Known Implementing Classes:
RedBlackMap
An interface to an immutable sorted map; the implementation guarantees that the state of the collection does not change.
-
Method Summary
Modifier and TypeMethodDescriptionclear()Returns a copy of this map that is empty.Returns a copy of this map that contains all entries of this map with the specified entry added or updated.default ImmutableSortedMap<K, V> Returns a copy of this map that contains all entries of this map with entries from the specified map added or updated.default ImmutableSortedMap<K, V> Returns a copy of this map that contains all entries of this map with entries from the specified map added or updated.default ImmutableSortedMap<K, V> putKeyValues(Object... kv) Returns a copy of this map that contains all entries of this map with entries from the specified map added or updated.Returns a copy of this map that contains all entries of this map with the specified entry removed.default ImmutableSortedMap<K, V> Returns a copy of this map that contains all entries of this map except the entries of the specified collection.default ImmutableSortedMap<K, V> Returns a copy of this map that contains only entries that are in this map and in the specified collection.default ImmutableSortedMap<K, V> retainAll(ReadOnlyCollection<? extends K> c) Returns a copy of this map that contains only entries that are in this map and in the specified collection.Methods inherited from interface org.jhotdraw8.icollection.immutable.ImmutableMap
maxSize, toMutableMethods inherited from interface org.jhotdraw8.icollection.readonly.ReadOnlyMap
containsEntry, containsKey, containsValue, equals, get, getOrDefault, hashCode, isEmpty, iterator, sizeMethods inherited from interface org.jhotdraw8.icollection.readonly.ReadOnlySequencedMap
asMap, firstEntry, lastEntry, readOnlyEntrySet, readOnlyKeySet, readOnlyReversed, readOnlyValuesMethods inherited from interface org.jhotdraw8.icollection.readonly.ReadOnlySortedMap
characteristics, comparator, spliterator
-
Method Details
-
clear
ImmutableSortedMap<K,V> clear()Description copied from interface:ImmutableMapReturns a copy of this map that is empty.- Specified by:
clearin interfaceImmutableMap<K,V> - Returns:
- this set instance if it is already empty, or a different set instance that is empty.
-
put
Description copied from interface:ImmutableMapReturns a copy of this map that contains all entries of this map with the specified entry added or updated.- Specified by:
putin interfaceImmutableMap<K,V> - Parameters:
key- the key of the entryvalue- the value of the entry- Returns:
- this map instance if it already contains the same entry, or a different map instance with the entry added or updated
-
putAll
Description copied from interface:ImmutableMapReturns a copy of this map that contains all entries of this map with entries from the specified map added or updated.- Specified by:
putAllin interfaceImmutableMap<K,V> - Parameters:
m- another map- Returns:
- this map instance if it already contains the same entries, or a different map instance with the entries added or updated
-
putAll
Description copied from interface:ImmutableMapReturns a copy of this map that contains all entries of this map with entries from the specified map added or updated.- Specified by:
putAllin interfaceImmutableMap<K,V> - Parameters:
c- another map- Returns:
- this map instance if it already contains the same entries, or a different map instance with the entries added or updated
-
putKeyValues
Description copied from interface:ImmutableMapReturns a copy of this map that contains all entries of this map with entries from the specified map added or updated.- Specified by:
putKeyValuesin interfaceImmutableMap<K,V> - Parameters:
kv- a list of alternating keys and values- Returns:
- this map instance if it already contains the same entries, or a different map instance with the entries added or updated
-
remove
Description copied from interface:ImmutableMapReturns a copy of this map that contains all entries of this map with the specified entry removed.- Specified by:
removein interfaceImmutableMap<K,V> - Parameters:
key- the key of the entry- Returns:
- this map instance if it already does not contain the entry, or a different map instance with the entry removed
-
removeAll
Description copied from interface:ImmutableMapReturns a copy of this map that contains all entries of this map except the entries of the specified collection.- Specified by:
removeAllin interfaceImmutableMap<K,V> - Parameters:
c- a collection with keys of entries to be removed from this map- Returns:
- this map instance if it already does not contain the entries, or a different map instance with the entries removed
-
retainAll
Description copied from interface:ImmutableMapReturns a copy of this map that contains only entries that are in this map and in the specified collection.- Specified by:
retainAllin interfaceImmutableMap<K,V> - Parameters:
c- a collection with keys of entries to be retained in this map- Returns:
- this map instance if it has not changed, or a different map instance with entries removed
-
retainAll
Description copied from interface:ImmutableMapReturns a copy of this map that contains only entries that are in this map and in the specified collection.- Specified by:
retainAllin interfaceImmutableMap<K,V> - Parameters:
c- a collection with keys of entries to be retained in this map- Returns:
- this map instance if it has not changed, or a different map instance with entries removed
-