Package helma.util
Class WrappedMap
java.lang.Object
helma.util.WrappedMap
- All Implemented Interfaces:
Map
- Direct Known Subclasses:
CopyOnWriteMap
A Map that wraps another map. We use this class to be able to
wrap maps as native objects within a scripting engine rather
than exposing them through Java reflection.
Additionally, instances of this class can be set to readonly
so that the original map can't be modified.
-
Nested Class Summary
-
Field Summary
Fields -
Constructor Summary
ConstructorsConstructorDescriptionWrappedMap
(Map map) ConstructorWrappedMap
(Map map, boolean readonly) Constructor -
Method Summary
Modifier and TypeMethodDescriptionvoid
clear()
boolean
containsKey
(Object key) boolean
containsValue
(Object value) entrySet()
boolean
int
hashCode()
boolean
isEmpty()
boolean
Is this map readonly?keySet()
void
void
setReadonly
(boolean readonly) Set the readonly flag on or offint
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
-
wrapped
-
readonly
protected boolean readonly
-
-
Constructor Details
-
WrappedMap
Constructor -
WrappedMap
Constructor
-
-
Method Details
-
setReadonly
public void setReadonly(boolean readonly) Set the readonly flag on or off -
isReadonly
public boolean isReadonly()Is this map readonly? -
size
public int size() -
isEmpty
public boolean isEmpty() -
containsKey
- Specified by:
containsKey
in interfaceMap
-
containsValue
- Specified by:
containsValue
in interfaceMap
-
get
-
put
-
remove
-
putAll
-
clear
public void clear() -
keySet
-
values
-
entrySet
-
equals
-
hashCode
public int hashCode() -
toString
-