public interface LongMap<V> extends Map<Long,V>
Map
with methods that are specific
for long
values.Modifier and Type | Interface and Description |
---|---|
static interface |
LongMap.Entry<V>
A map entry (key-value pair).
|
Modifier and Type | Method and Description |
---|---|
default V |
compute(long key,
BiFunction<? super Long,? super V,? extends V> remappingFunction)
Attempts to compute a mapping for the specified key and its current
mapped value (or
null if there is no current mapping). |
default V |
computeIfAbsent(long key,
Function<? super Long,? extends V> mappingFunction)
If the specified key is not already associated with a value (or is mapped
to
null ), attempts to compute its value using the given mapping
function and enters it into this map unless null . |
default V |
computeIfPresent(long key,
BiFunction<? super Long,? super V,? extends V> remappingFunction)
If the value for the specified key is present and non-null, attempts to
compute a new mapping given the key and its current mapped value.
|
boolean |
containsKey(long key)
Returns true if this map contains a mapping for the specified
key.
|
V |
get(long key)
Returns the value to which this map maps the specified key.
|
default V |
getOrDefault(long key,
V defaultValue)
Returns the value to which this map maps the specified key.
|
LongSet |
longKeySet()
Returns a set view of the keys contained in this map.
|
default V |
merge(long key,
V value,
BiFunction<? super V,? super V,? extends V> remappingFunction)
If the specified key is not already associated with a value or is
associated with null, associates it with the given non-null value.
|
V |
put(long key,
V value)
Associates the specified value with the specified key in this map.
|
default V |
putIfAbsent(long key,
V value)
If the specified key is not already associated with a value (or is mapped
to
null ) associates it with the given value and returns
null , else returns the current value. |
V |
remove(long key)
Removes the mapping for this key from this map if present.
|
default boolean |
remove(long key,
Object value)
Removes the entry for the specified key only if it is currently
mapped to the specified value.
|
default V |
replace(long key,
V value)
Replaces the entry for the specified key only if it is
currently mapped to some value.
|
default boolean |
replace(long key,
V oldValue,
V newValue)
Replaces the entry for the specified key only if currently
mapped to the specified value.
|
clear, compute, computeIfAbsent, computeIfPresent, containsKey, containsValue, entrySet, equals, forEach, get, getOrDefault, hashCode, isEmpty, keySet, merge, put, putAll, putIfAbsent, remove, remove, replace, replace, replaceAll, size, values
boolean containsKey(long key)
Map.containsKey(Object)
V get(long key)
Map.get(Object)
V put(long key, V value)
Map.put(Object, Object)
V remove(long key)
Map.remove(Object)
LongSet longKeySet()
Map.keySet()
default V getOrDefault(long key, V defaultValue)
defaultValue
if the map contains no mapping for this key.Map.getOrDefault(Object, Object)
default V putIfAbsent(long key, V value)
null
) associates it with the given value and returns
null
, else returns the current value.Map.putIfAbsent(Object, Object)
default boolean replace(long key, V oldValue, V newValue)
Map.replace(Object, Object, Object)
default V replace(long key, V value)
Map.replace(Object, Object)
default V computeIfAbsent(long key, Function<? super Long,? extends V> mappingFunction)
null
), attempts to compute its value using the given mapping
function and enters it into this map unless null
.Map.computeIfAbsent(Object, Function)
default V computeIfPresent(long key, BiFunction<? super Long,? super V,? extends V> remappingFunction)
Map.computeIfPresent(Object, BiFunction)
default V compute(long key, BiFunction<? super Long,? super V,? extends V> remappingFunction)
null
if there is no current mapping).Map.compute(Object, BiFunction)
default V merge(long key, V value, BiFunction<? super V,? super V,? extends V> remappingFunction)
null
. This
method may be of use when combining multiple mapped values for a key.Map.merge(Object, Object, BiFunction)
default boolean remove(long key, Object value)
Map.remove(Object, Object)
Copyright © 2002–2025 Devexperts LLC. All rights reserved.