Package eu.bandm.tools.umod.runtime
Class MapProxy<D,R>
java.lang.Object
eu.bandm.tools.umod.runtime.MapProxy<D,R>
- All Implemented Interfaces:
Serializable
,Map<D,
R>
- Direct Known Subclasses:
CheckedMap_D
,CheckedMap_R
,CheckedMap_RD
Implements a map by delegation to some peer object from a
predefined java runtime class. The kind of implementation (hash map or
tree map) can be selected by a parameter to the constructor.
Is used for checked maps, therefore the "put" methods (etc.) are implemented in the sub-classes and treated here as "abstract".
- See Also:
-
Nested Class Summary
Modifier and TypeClassDescriptionprotected static class
protected static class
protected static class
putting null as a value (not a key) must also be prevented on the folloing chain: CheckedMap -> entrySet() -> CheckedMapEntrySet -> iterator() -> CheckedMapEntryIterator -> next() -> CheckedMapEntrystatic enum
-
Field Summary
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionasSorted()
Returns a sorted, unmodifiable view IFF the backing peer is a sorted map.void
clear()
boolean
containsKey
(Object key) boolean
containsValue
(Object value) entrySet()
Will be overridden for R = range checked maps.boolean
int
hashCode()
boolean
isEmpty()
keySet()
Is overridden by subclass to make non-null checks.void
Is overridden by subclass to make non-null checks.int
size()
toString()
values()
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
Methods inherited from interface java.util.Map
compute, computeIfAbsent, computeIfPresent, forEach, getOrDefault, merge, putIfAbsent, remove, replace, replace, replaceAll
-
Field Details
-
peer
-
-
Constructor Details
-
MapProxy
public MapProxy() -
MapProxy
-
MapProxy
-
-
Method Details
-
toString
-
asSorted
Returns a sorted, unmodifiable view IFF the backing peer is a sorted map. This is currently only the case when theimplementstion
has been explicitly seelected astree
on creation.- Throws:
UnsupportedOperationException
- if the backing peer does not offer a sorted view.
-
clear
public void clear() -
containsKey
- Specified by:
containsKey
in interfaceMap<D,
R>
-
containsValue
- Specified by:
containsValue
in interfaceMap<D,
R>
-
entrySet
Will be overridden for R = range checked maps. java doc says "[Map.entrySet()} does not support the add or addAll operations" -
equals
-
get
-
hashCode
public int hashCode() -
isEmpty
public boolean isEmpty() -
keySet
-
put
Is overridden by subclass to make non-null checks. -
putAll
Is overridden by subclass to make non-null checks. -
remove
-
size
public int size() -
values
-