Package org.gridgain.structure
Interface IgniteMap<K,V>
- Type Parameters:
K- The type of the key.V- The type of the value.
public interface IgniteMap<K,V>
An object that maps keys to values. A map cannot contain duplicate keys;
each key can map to at most one value.
-
Method Summary
Modifier and TypeMethodDescriptionvoidclear()Removes all of the mappings from this map.Removes all of the mappings from this map.booleancontainsKey(K key) Returnstrueif this map contains a mapping for the specified key.containsKeyAsync(K key) Returnstrueif this map contains a mapping for the specified key.Returns the value to which the specified key is mapped, ornullif this map contains no mapping for the key.getAll()Returns read-only cursor to all entries from map.Returns read-only async cursor to all entries from map.Returns the value to which the specified key is mapped, ornullif this map contains no mapping for the key.booleanisEmpty()Returnstrueif this map contains no key-value mappings.Returnstrueif this map contains no key-value mappings.Associates the specified value with the specified key in this map.voidCopies all of the mappings from the specified map to this map (optional operation).putAllAsync(Map<? extends K, ? extends V> m) Copies all of the mappings from the specified map to this map.Associates the specified value with the specified key in this map.Removes the mapping for a key from this map if it is present.removeAsync(K key) Removes the mapping for a key from this map if it is present.longsize()Returns the number of key-value mappings in this map.Returns the number of key-value mappings in this map.
-
Method Details
-
putAsync
Associates the specified value with the specified key in this map. If the map previously contained a mapping for the key, the old value is replaced by the specified value.- Returns:
- the previous value associated with
key, ornullif there was no mapping forkey.
-
put
Associates the specified value with the specified key in this map. If the map previously contained a mapping for the key, the old value is replaced by the specified value.- Returns:
- the previous value associated with
key, ornullif there was no mapping forkey.
-
removeAsync
Removes the mapping for a key from this map if it is present.- Returns:
- the value to which this map previously associated the key, or
nullif the map contained no mapping for the key.
-
remove
Removes the mapping for a key from this map if it is present.- Returns:
- the value to which this map previously associated the key, or
nullif the map contained no mapping for the key.
-
putAllAsync
Copies all of the mappings from the specified map to this map. The effect of this call is equivalent to that of callingputAsyncon this map once for each mapping from keykto valuevin the specified map. -
putAll
Copies all of the mappings from the specified map to this map (optional operation). The effect of this call is equivalent to that of callingputAsyncon this map once for each mapping from keykto valuevin the specified map. -
getAsync
Returns the value to which the specified key is mapped, ornullif this map contains no mapping for the key. -
get
Returns the value to which the specified key is mapped, ornullif this map contains no mapping for the key. -
containsKeyAsync
Returnstrueif this map contains a mapping for the specified key. More formally, returnstrueif and only if this map contains a mapping for a keyksuch thatObjects.equals(key, k). (There can be at most one such mapping.) -
containsKey
Returnstrueif this map contains a mapping for the specified key. More formally, returnstrueif and only if this map contains a mapping for a keyksuch thatObjects.equals(key, k). (There can be at most one such mapping.) -
sizeAsync
CompletableFuture<Long> sizeAsync()Returns the number of key-value mappings in this map. -
size
long size()Returns the number of key-value mappings in this map. -
isEmptyAsync
CompletableFuture<Boolean> isEmptyAsync()Returnstrueif this map contains no key-value mappings. -
isEmpty
boolean isEmpty()Returnstrueif this map contains no key-value mappings. -
getAllAsync
CompletableFuture<AsyncCursor<Map.Entry<K,V>>> getAllAsync()Returns read-only async cursor to all entries from map. -
getAll
AsyncCursor<Map.Entry<K,V>> getAll()Returns read-only cursor to all entries from map. -
clearAsync
CompletableFuture<Void> clearAsync()Removes all of the mappings from this map. The map will be empty after this call returns. -
clear
void clear()Removes all of the mappings from this map. The map will be empty after this call returns.
-