Package helma.util
Class CopyOnWriteMap
java.lang.Object
helma.util.WrappedMap
helma.util.CopyOnWriteMap
- All Implemented Interfaces:
Map
A Map that wraps another map and creates a new copy of the
wrapped map if we try to modify it. This class is wrapped
as a native scripted object in JavaScript rather than exposing
them through Java reflection.
All methods in this class are synchronized in order not
to miss the switch between original and copied map.
-
Nested Class Summary
-
Field Summary
Fields inherited from class helma.util.WrappedMap
readonly, wrapped
-
Constructor Summary
Constructors -
Method Summary
Methods inherited from class helma.util.WrappedMap
isReadonly, setReadonly
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
-
Constructor Details
-
CopyOnWriteMap
Constructor
-
-
Method Details
-
wasModified
public boolean wasModified() -
size
public int size()- Specified by:
size
in interfaceMap
- Overrides:
size
in classWrappedMap
-
isEmpty
public boolean isEmpty()- Specified by:
isEmpty
in interfaceMap
- Overrides:
isEmpty
in classWrappedMap
-
containsKey
- Specified by:
containsKey
in interfaceMap
- Overrides:
containsKey
in classWrappedMap
-
containsValue
- Specified by:
containsValue
in interfaceMap
- Overrides:
containsValue
in classWrappedMap
-
get
- Specified by:
get
in interfaceMap
- Overrides:
get
in classWrappedMap
-
put
- Specified by:
put
in interfaceMap
- Overrides:
put
in classWrappedMap
-
remove
- Specified by:
remove
in interfaceMap
- Overrides:
remove
in classWrappedMap
-
putAll
- Specified by:
putAll
in interfaceMap
- Overrides:
putAll
in classWrappedMap
-
clear
public void clear()- Specified by:
clear
in interfaceMap
- Overrides:
clear
in classWrappedMap
-
keySet
- Specified by:
keySet
in interfaceMap
- Overrides:
keySet
in classWrappedMap
-
values
- Specified by:
values
in interfaceMap
- Overrides:
values
in classWrappedMap
-
entrySet
- Specified by:
entrySet
in interfaceMap
- Overrides:
entrySet
in classWrappedMap
-
equals
- Specified by:
equals
in interfaceMap
- Overrides:
equals
in classWrappedMap
-
hashCode
public int hashCode()- Specified by:
hashCode
in interfaceMap
- Overrides:
hashCode
in classWrappedMap
-
toString
- Overrides:
toString
in classWrappedMap
-