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.voiddestroy()Destroys this map, removing all data and the map definition.Destroys this map, removing all data and the map definition.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.Associates the specified value with the specified key in this map and returns the previous value.getAndPutAsync(K key, V value) Associates the specified value with the specified key in this map and returns the previous value.getAndRemove(K key) Removes the mapping for a key from this map if it is present and returns the previous value.getAndRemoveAsync(K key) Removes the mapping for a key from this map if it is present and returns the previous value.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.voidAssociates 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.booleanRemoves the mapping for a key from this map if it is present.voidremoveAll(Collection<K> keys) Removes all mappings for the specified keys from this map.removeAllAsync(Collection<K> keys) Removes all mappings for the specified keys from this map.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.- Parameters:
key- Key with which the specified value is to be associated.value- Value to be associated with the specified key.
-
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.- Parameters:
key- Key with which the specified value is to be associated.value- Value to be associated with the specified key.
-
getAndPutAsync
Associates the specified value with the specified key in this map and returns the previous value. If the map previously contained a mapping for the key, the old value is replaced by the specified value.- Parameters:
key- Key with which the specified value is to be associated.value- Value to be associated with the specified key.- Returns:
- the previous value associated with
key, ornullif there was no mapping forkey.
-
getAndPut
Associates the specified value with the specified key in this map and returns the previous value. If the map previously contained a mapping for the key, the old value is replaced by the specified value.- Parameters:
key- Key with which the specified value is to be associated.value- Value to be associated with the specified key.- 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.- Parameters:
key- Key whose mapping is to be removed from the map.- Returns:
trueif the key was removed,falseif the map contained no mapping for the key.
-
remove
Removes the mapping for a key from this map if it is present.- Parameters:
key- Key whose mapping is to be removed from the map.- Returns:
trueif the key was removed,falseif the map contained no mapping for the key.
-
getAndRemoveAsync
Removes the mapping for a key from this map if it is present and returns the previous value.- Parameters:
key- Key whose mapping is to be removed from the map.- Returns:
- the value to which this map previously associated the key, or
nullif the map contained no mapping for the key.
-
getAndRemove
Removes the mapping for a key from this map if it is present and returns the previous value.- Parameters:
key- Key whose mapping is to be removed from the map.- Returns:
- the value to which this map previously associated the key, or
nullif the map contained no mapping for the key.
-
removeAllAsync
Removes all mappings for the specified keys from this map.- Parameters:
keys- Keys whose mappings are to be removed from the map.
-
removeAll
Removes all mappings for the specified keys from this map.- Parameters:
keys- Keys whose mappings are to be removed from the map.
-
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. -
destroyAsync
CompletableFuture<Void> destroyAsync()Destroys this map, removing all data and the map definition. After this operation, the map can no longer be used. -
destroy
void destroy()Destroys this map, removing all data and the map definition. After this operation, the map can no longer be used.
-