Package components.map
Class MapSecondary<K,V>
java.lang.Object
components.map.MapSecondary<K,V>
- Type Parameters:
K
- type ofMap
domain (key) entriesV
- type ofMap
range (associated value) entries
Layered implementations of secondary methods for
Map
.-
Nested Class Summary
Modifier and TypeClassDescriptionprotected static final class
Straightforward implementation ofPair
interface. -
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionvoid
combineWith
(Map<K, V> m) Combinesm
withthis
.final boolean
int
hashCode()
boolean
Reports whether there is a pair inthis
whose second component isvalue
.Reports a key associated withvalue
inthis
.replaceValue
(K key, V value) Replaces the value associated withkey
inthis
withvalue
and returns the old value.boolean
sharesKeyWith
(Map<K, V> m) Reports whetherthis
andm
have any keys in common.toString()
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
Methods inherited from interface java.lang.Iterable
forEach, iterator, spliterator
Methods inherited from interface components.map.MapKernel
add, hasKey, remove, removeAny, size, value
Methods inherited from interface components.standard.Standard
clear, newInstance, transferFrom
-
Constructor Details
-
MapSecondary
public MapSecondary()
-
-
Method Details
-
equals
-
hashCode
-
toString
-
replaceValue
Description copied from interface:Map
Replaces the value associated withkey
inthis
withvalue
and returns the old value.- Specified by:
replaceValue
in interfaceMap<K,
V> - Parameters:
key
- the key whose associated value is replacedvalue
- the value replacing the old one- Returns:
- the old value associated with the given key
-
key
Description copied from interface:Map
Reports a key associated withvalue
inthis
. Note that the key returned generally should not be changed at all via this aliased reference, and if it is then it definitely must not be changed in such a way that it equals another key in the map from which it was obtained. -
hasValue
Description copied from interface:Map
Reports whether there is a pair inthis
whose second component isvalue
. -
combineWith
Description copied from interface:Map
Combinesm
withthis
.- Specified by:
combineWith
in interfaceMap<K,
V> - Parameters:
m
- theMap
to be combined withthis
-