org.apache.ignite.internal

## Class ClusterNodeLocalMapImpl<K,V>

- java.lang.Object
- - org.jdk8.backport.ConcurrentHashMap8<K,V>
  - - org.apache.ignite.internal.ClusterNodeLocalMapImpl<K,V>

All Implemented Interfaces:
  Externalizable, Serializable, ConcurrentMap<K,V>, Map<K,V>, ClusterNodeLocalMap<K,V>

    public class ClusterNodeLocalMapImpl<K,V>
    extends ConcurrentHashMap8<K,V>
    implements ClusterNodeLocalMap<K,V>, Externalizable

See Also:
  Serialized Form

### Nested Class Summary

### Nested classes/interfaces inherited from class org.jdk8.backport.ConcurrentHashMap8

`ConcurrentHashMap8.Action<A>, ConcurrentHashMap8.BiAction<A,B>, ConcurrentHashMap8.BiFun<A,B,T>, ConcurrentHashMap8.DoubleByDoubleToDouble, ConcurrentHashMap8.DoubleToDouble, ConcurrentHashMap8.EntrySetView<K,V>, ConcurrentHashMap8.Fun<A,T>, ConcurrentHashMap8.Generator<T>, ConcurrentHashMap8.IntByIntToInt, ConcurrentHashMap8.IntToInt, ConcurrentHashMap8.KeySetView<K,V>, ConcurrentHashMap8.LongByLongToLong, ConcurrentHashMap8.LongToLong, ConcurrentHashMap8.ObjectByObjectToDouble<A,B>, ConcurrentHashMap8.ObjectByObjectToInt<A,B>, ConcurrentHashMap8.ObjectByObjectToLong<A,B>, ConcurrentHashMap8.ObjectToDouble<A>, ConcurrentHashMap8.ObjectToInt<A>, ConcurrentHashMap8.ObjectToLong<A>, ConcurrentHashMap8.Spliterator<T>, ConcurrentHashMap8.ValuesView<K,V>`

### Nested classes/interfaces inherited from interface java.util.Map

`Map.Entry<K,V>`

### Constructor Summary

Constructors
Constructor and Description
`ClusterNodeLocalMapImpl()` No-arg constructor is required by externalization.

### Method Summary

Methods
`V` `addIfAbsent(K key, Callable<V> dflt)` Gets the value with given key.
`V` `addIfAbsent(K key, V val)` Unlike its sibling method `ConcurrentMap.putIfAbsent(Object, Object)` this method returns current mapping from the map.
`void` `readExternal(ObjectInput in)`
`protected Object` `readResolve()` Reconstructs object on unmarshalling.
`String` `toString()` Returns a string representation of this map.
`void` `writeExternal(ObjectOutput out)`

### Methods inherited from class org.jdk8.backport.ConcurrentHashMap8

`clear, compute, computeIfAbsent, computeIfPresent, contains, containsKey, containsValue, elements, entrySet, entrySpliterator, equals, get, getValueOrDefault, hashCode, isEmpty, keys, keySet, keySet, keySpliterator, mappingCount, merge, newKeySet, newKeySet, put, putAll, putIfAbsent, remove, remove, replace, replace, size, values, valueSpliterator`

### Methods inherited from class java.lang.Object

`clone, finalize, getClass, notify, notifyAll, wait, wait, wait`

### Methods inherited from interface java.util.concurrent.ConcurrentMap

`putIfAbsent, remove, replace, replace`

### Methods inherited from interface java.util.Map

`clear, containsKey, containsValue, entrySet, equals, get, hashCode, isEmpty, keySet, put, putAll, remove, size, values`

### Constructor Detail

#### ClusterNodeLocalMapImpl

    public ClusterNodeLocalMapImpl()

No-arg constructor is required by externalization.

### Method Detail

#### addIfAbsent

    @Nullable
    public V addIfAbsent(K key,
                         @Nullable
                         Callable<V> dflt)

Gets the value with given key. If that value does not exist, calls given closure to get the default value, puts it into the map and returns it. If closure is `null` return `null`.

Specified by:
  `addIfAbsent` in interface `ClusterNodeLocalMap<K,V>`
Parameters:
  `key` - Key to get the value for.
  `dflt` - Default value producing closure.
Returns:
  Value for the key or the value produced by the closure if key does not exist in the map. Return `null` if key is not found and closure is `null`.

#### addIfAbsent

    public V addIfAbsent(K key,
                V val)

Unlike its sibling method `ConcurrentMap.putIfAbsent(Object, Object)` this method returns current mapping from the map.

Specified by:
  `addIfAbsent` in interface `ClusterNodeLocalMap<K,V>`
Parameters:
  `key` - Key.
  `val` - Value to put if one does not exist.
Returns:
  Current mapping for a given key.

#### writeExternal

    public void writeExternal(ObjectOutput out)
                       throws IOException

Specified by:
  `writeExternal` in interface `Externalizable`
Throws:
  `IOException`

#### readExternal

    public void readExternal(ObjectInput in)
                      throws IOException,
                             ClassNotFoundException

Specified by:
  `readExternal` in interface `Externalizable`
Throws:
  `IOException`
  `ClassNotFoundException`

#### readResolve

    protected Object readResolve()
                          throws ObjectStreamException

Reconstructs object on unmarshalling.

Returns:
  Reconstructed object.
Throws:
  `ObjectStreamException` - Thrown in case of unmarshalling error.

#### toString

    public String toString()

Returns a string representation of this map. The string representation consists of a list of key-value mappings (in no particular order) enclosed in braces ("`{}`"). Adjacent mappings are separated by the characters `", "` (comma and space). Each key-value mapping is rendered as the key followed by an equals sign ("`=`") followed by the associated value.

Overrides:
  `toString` in class `ConcurrentHashMap8<K,V>`
Returns:
  a string representation of this map

2015 Copyright © Apache Software Foundation

Follow @ApacheIgnite

Ignite Fabric | : ver. 1.0.0-RC1
Release Date | : February 17 2015