Java in a Nutshell, 5th Edition [Electronic resources] نسخه متنی

اینجــــا یک کتابخانه دیجیتالی است

با بیش از 100000 منبع الکترونیکی رایگان به زبان فارسی ، عربی و انگلیسی

Java in a Nutshell, 5th Edition [Electronic resources] - نسخه متنی

| نمايش فراداده ، افزودن یک نقد و بررسی
افزودن به کتابخانه شخصی
ارسال به دوستان
جستجو در متن کتاب
بیشتر
تنظیمات قلم

فونت

اندازه قلم

+ - پیش فرض

حالت نمایش

روز نیمروز شب
جستجو در لغت نامه
بیشتر
لیست موضوعات
توضیحات
افزودن یادداشت جدید


ConcurrentMap<K,V>java.util.concurrent

Java 5.0collection

This interface extends the
java.util.Map interface to add four important
atomic methods. As with the Map interface, the
type variables K and
V represent the types of the mapped keys
and values.

putIfAbsent( ) atomically tests whether a key is
already defined in the map, and if not, maps it to the specified
value. remove( ) atomically removes the specified
key from the map, but only if it is mapped to the specified value. It
returns true if it modified the map. There are two
versions of the atomic replace( ) method. The
first checks whether the specified value is already mapped to a
value. If so, it replaces the existing mapping with the specified
value and returns true. Otherwise, it returns
false. The three-argument version of
replace( ) maps the specified key to the specified
new value, but only if the key is currently mapped to the specified
old value. It returns true if the replacement was
made and false otherwise.


Figure 16-77. java.util.concurrent.ConcurrentMap<K,V>

public interface

ConcurrentMap<K,V> extends java.util.Map<K,V> {
// Public Instance Methods
V

putIfAbsent (K

key , V

value );
boolean

remove (Object

key , Object

value );
V

replace (K

key , V

value );
boolean

replace (K

key , V

oldValue , V

newValue );
}


Implementations


ConcurrentHashMap


    / 1191