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
Nested ClassesModifier and TypeClassDescriptionstatic final classCopyOnWriteMapbacked byHashMap.static final classCopyOnWriteMapbacked byTreeMap. -
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidclear()booleancontainsKey(Object key) booleancontainsValue(Object value) copy()entrySet()This method will return a read-onlySet.booleangetView()inthashCode()booleanisEmpty()keySet()This method will return a read-onlySet.voidvoidAtomically replaces the entire map by the copy of the specified map.intsize()toString()protected voidvalues()This method will return a read-onlyCollection.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
-
core
-
-
Constructor Details
-
CopyOnWriteMap
-
CopyOnWriteMap
protected CopyOnWriteMap()
-
-
Method Details
-
getView
-
createView
-
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:
containsKeyin interfaceMap<K,V>
-
containsValue
- Specified by:
containsValuein 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
-