org.apache.ignite.internal.util.collection

## Class IntRWHashMap<V>

- java.lang.Object
- - org.apache.ignite.internal.util.collection.IntRWHashMap<V>

All Implemented Interfaces:
  IntMap<V>

    public class IntRWHashMap<V>
    extends Object
    implements IntMap<V>

Read-write lock wrapper for `IntMap`.

### Nested Class Summary

### Nested classes/interfaces inherited from interface org.apache.ignite.internal.util.collection.IntMap

`IntMap.EntryConsumer<V,E extends Throwable>`

### Constructor Summary

Constructors
Constructor and Description
`IntRWHashMap()` Default constructor.

### Method Summary

All Methods Instance Methods Concrete Methods
`boolean` `containsKey(int key)` Returns `true` if the map contains the key, otherwise `false`.
`boolean` `containsValue(V val)` Returns `true` if the map contains one or more values, otherwise `false`.
`<E extends Throwable> void` `forEach(IntMap.EntryConsumer<V,E> act)` This method work under a read lock, be careful with long operations inside.
`V` `get(int key)` Returns value associated with the key. if the map doesn't contain the key, returns null.
`boolean` `isEmpty()` Returns `true` if this map contains no key-value mappings.
`V` `put(int key, V val)` Save the pair into the map.
`V` `putIfAbsent(int key, V val)` Does put into the map if a pair isn't present, otherwise returns stored value.
`V` `remove(int key)`
`int` `size()` Returns count of elements.
`String` `toString()`

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

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

### Constructor Detail

#### IntRWHashMap

    public IntRWHashMap()

Default constructor.

### Method Detail

#### get

    public V get(int key)

Returns value associated with the key. if the map doesn't contain the key, returns null.

Specified by:
  `get` in interface `IntMap<V>`
Parameters:
  `key` - key with which the specified value is to be associated.

#### put

    public V put(int key,
                 V val)

Save the pair into the map. If a pair is present, returns old value and store new.

Specified by:
  `put` in interface `IntMap<V>`
Parameters:
  `key` - key with which the specified value is to be associated.
  `val` - value to be associated with the specified key.

#### remove

    public V remove(int key)

Specified by:
  `remove` in interface `IntMap<V>`
Parameters:
  `key` - key with which the specified value is to be associated.

#### putIfAbsent

    public V putIfAbsent(int key,
                         V val)

Does put into the map if a pair isn't present, otherwise returns stored value.

Specified by:
  `putIfAbsent` in interface `IntMap<V>`
Parameters:
  `key` - key with which the specified value is to be associated..
  `val` - value to be associated with the specified key..

#### forEach

    public <E extends Throwable> void forEach(IntMap.EntryConsumer<V,E> act)
                                       throws E extends Throwable

This method work under a read lock, be careful with long operations inside.

Specified by:
  `forEach` in interface `IntMap<V>`
Parameters:
  `act` - Action.
Throws:
  `E extends Throwable`

#### size

    public int size()

Returns count of elements.

Specified by:
  `size` in interface `IntMap<V>`

#### isEmpty

    public boolean isEmpty()

Returns `true` if this map contains no key-value mappings.

Specified by:
  `isEmpty` in interface `IntMap<V>`

#### containsKey

    public boolean containsKey(int key)

Returns `true` if the map contains the key, otherwise `false`.

Specified by:
  `containsKey` in interface `IntMap<V>`
Parameters:
  `key` - tests key value.

#### containsValue

    public boolean containsValue(V val)

Returns `true` if the map contains one or more values, otherwise `false`.

Specified by:
  `containsValue` in interface `IntMap<V>`
Parameters:
  `val` - value to be associated with the specified key.

#### toString

    public String toString()

Overrides:
  `toString` in class `Object`

${current.year} Copyright © Apache Software Foundation

Follow @ApacheIgnite

Ignite Database and Caching Platform | : ver. 2.9.1
Release Date | : December 9 2020