Collections.Map.Concurrent.replace()

Signature

Object replace ( Object map ,Object key ,Object value )

Domain

ACTION

Description

Replace entry for key only if currently mapped to some value. The action is performed atomically.

Parameters

NameTypeDescription
mapObjectThe concurrent map object
keyObjectkey with which the specified value is to be associated.
valueObjectvalue to be associated with the specified key.

Returns

TypeDescription
ObjectReturns an object which is the previously associated value with the key
If the key doesnot exist then returns null

Cautions

none