Java集合源码学习(23)_Map的子接口ConcurrentMap

来源:互联网 发布:java常用设计模式图解 编辑:程序博客网 时间:2024/05/21 11:23

定义了几个原子的操作方法:



Method Summary VputIfAbsent(K key, V value) 
          If the specified key is not already associated with a value, associate it with the given value. booleanremove(Object key, Object value) 
          Removes the entry for a key only if currently mapped to a given value. Vreplace(K key, V value) 
          Replaces the entry for a key only if currently mapped to some value. booleanreplace(K key, V oldValue, V newValue) 
          Replaces the entry for a key only if currently mapped to a given value.

Method Summary VputIfAbsent(K key, V value) 
          If the specified key is not already associated with a value, associate it with the given value. booleanremove(Object key, Object value) 
          Removes the entry for a key only if currently mapped to a given value. Vreplace(K key, V value) 
          Replaces the entry for a key only if currently mapped to some value. booleanreplace(K key, V oldValue, V newValue) 
          Replaces the entry for a key only if currently mapped to a given value.
0 0
原创粉丝点击