Package hudson.util
Class CopyOnWriteMap<K,V>
java.lang.Object
hudson.util.CopyOnWriteMap<K,V>
- All Implemented Interfaces:
Map<K,
V>
- Direct Known Subclasses:
CopyOnWriteMap.Hash
,CopyOnWriteMap.Tree
Map
that has copy-on-write semantics.
This class is suitable where highly concurrent access is needed, yet the write operation is relatively uncommon.
- Author:
- Kohsuke Kawaguchi
-
Nested Class Summary
Modifier and TypeClassDescriptionstatic final class
CopyOnWriteMap
backed byHashMap
.static final class
CopyOnWriteMap
backed byTreeMap
. -
Field Summary
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionvoid
clear()
boolean
containsKey
(Object key) boolean
containsValue
(Object value) copy()
entrySet()
This method will return a read-onlySet
.boolean
int
hashCode()
boolean
isEmpty()
keySet()
This method will return a read-onlySet
.void
void
Atomically replaces the entire map by the copy of the specified map.int
size()
toString()
protected void
values()
This method will return a read-onlyCollection
.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
-
core
-
-
Constructor Details
-
CopyOnWriteMap
-
CopyOnWriteMap
protected CopyOnWriteMap()
-
-
Method Details
-
update
-
replaceBy
Atomically replaces the entire map by the copy of the specified map. -
size
public int size() -
isEmpty
public boolean isEmpty() -
containsKey
- Specified by:
containsKey
in interfaceMap<K,
V>
-
containsValue
- Specified by:
containsValue
in interfaceMap<K,
V>
-
get
-
put
-
remove
-
putAll
-
copy
-
clear
public void clear() -
keySet
This method will return a read-onlySet
. -
values
This method will return a read-onlyCollection
. -
entrySet
This method will return a read-onlySet
. -
hashCode
public int hashCode() -
equals
-
toString
-