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
Nested ClassesModifier and TypeClassDescriptionprotected static classprotected static classprotected static classputting 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
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionasSorted()Returns a sorted, unmodifiable view IFF the backing peer is a sorted map.voidclear()booleancontainsKey(Object key) booleancontainsValue(Object value) entrySet()Will be overridden for R = range checked maps.booleaninthashCode()booleanisEmpty()keySet()Is overridden by subclass to make non-null checks.voidIs overridden by subclass to make non-null checks.intsize()toString()values()Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, waitMethods 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 theimplementstionhas been explicitly seelected astreeon creation.- Throws:
UnsupportedOperationException- if the backing peer does not offer a sorted view.
-
clear
public void clear() -
containsKey
- Specified by:
containsKeyin interfaceMap<D,R>
-
containsValue
- Specified by:
containsValuein 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
-