Class IntRWHashMap<V>
- java.lang.Object
-
- org.apache.ignite.internal.util.collection.IntRWHashMap<V>
-
-
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 Description IntRWHashMap()Default constructor.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidclear()Removes all of the mappings from this map.booleancontainsKey(int key)Returns true if the map contains the key, otherwise false.booleancontainsValue(V val)Returns true if the map contains one or more values, otherwise false.<E extends Throwable>
voidforEach(IntMap.EntryConsumer<V,E> act)This method work under a read lock, be careful with long operations inside.Vget(int key)Returns value associated with the key. if the map doesn't contain the key, returns null.booleanisEmpty()Returns true if this map contains no key-value mappings.int[]keys()Returns array of keys.Vput(int key, V val)Save the pair into the map.VputIfAbsent(int key, V val)Does put into the map if a pair isn't present, otherwise returns stored value.Vremove(int key)intsize()Returns count of elements.StringtoString()Collection<V>values()Returns a collection of values.-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
-
Methods inherited from interface org.apache.ignite.internal.util.collection.IntMap
computeIfAbsent
-
-
-
-
Method Detail
-
get
public V get(int key)
Returns value associated with the key. if the map doesn't contain the key, returns null.
-
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.
-
remove
public V remove(int key)
-
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:
putIfAbsentin interfaceIntMap<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.
-
isEmpty
public boolean isEmpty()
Returns true if this map contains no key-value mappings.
-
values
public Collection<V> values()
Returns a collection of values.
-
containsKey
public boolean containsKey(int key)
Returns true if the map contains the key, otherwise false.- Specified by:
containsKeyin interfaceIntMap<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:
containsValuein interfaceIntMap<V>- Parameters:
val- value to be associated with the specified key.
-
clear
public void clear()
Removes all of the mappings from this map.
-
-