Package space.vectrix.flare.fastutil
Interface Float2ObjectSyncMap.ExpungingEntry<V>
-
- Type Parameters:
V- the backing value type
- Enclosing interface:
- Float2ObjectSyncMap<V>
public static interface Float2ObjectSyncMap.ExpungingEntry<V>The expunging value the backing map wraps for its values.- Since:
- 2.0.0
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description @Nullable Vclear()Clears the value.@NonNull Float2ObjectSyncMap.InsertionResult<V>compute(float key, @NonNull BiFunction<? super Float,? super V,? extends V> remappingFunction)Computes the specified value, returning anFloat2ObjectSyncMap.InsertionResult.@NonNull Float2ObjectSyncMap.InsertionResult<V>computeIfAbsent(float key, @NonNull DoubleFunction<? extends V> function)Computes the specified value if a value doesn't already exist, returning anFloat2ObjectSyncMap.InsertionResult.@NonNull Float2ObjectSyncMap.InsertionResult<V>computeIfAbsentPrimitive(float key, @NonNull it.unimi.dsi.fastutil.floats.Float2ObjectFunction<? extends V> function)Computes the specified value if a value doesn't already exist, returning anFloat2ObjectSyncMap.InsertionResult.@NonNull Float2ObjectSyncMap.InsertionResult<V>computeIfPresent(float key, @NonNull BiFunction<? super Float,? super V,? extends V> remappingFunction)Computes the specified value if a value already exists, returning anFloat2ObjectSyncMap.InsertionResult.booleanexists()Returnstrueif this entry has a value, that is neithernullor expunged.@Nullable Vget()Returns the value ornullif it has been expunged.@NonNull VgetOr(@NonNull V other)Returns the value if it exists, otherwise it returns the default value.booleanreplace(@NonNull Object compare, @Nullable V value)Replaces the current value if it matchescomparewith the newvalueand returnstrue.voidset(@NonNull V value)Sets the value.@NonNull Float2ObjectSyncMap.InsertionResult<V>setIfAbsent(@NonNull V value)Sets the specified value if a value doesn't already exist, returning anFloat2ObjectSyncMap.InsertionResult.booleantryExpunge()Attempts to expunge the value, if the value isnulland returnstrue.@Nullable VtryReplace(@NonNull V value)Attempts to replace the value, if the value is not expunged ornulland returns the previous value.booleantrySet(@NonNull V value)Attempts to set the value, if the value is not expunged and returnstrue.booleantryUnexpungeAndCompute(float key, @NonNull BiFunction<? super Float,? super V,? extends V> remappingFunction)Attempts to unexpunge the value and compute it, if the value was expunged and returnstrue.booleantryUnexpungeAndCompute(float key, @NonNull DoubleFunction<? extends V> function)Attempts to unexpunge the value and compute it, if the value was expunged and returnstrue.booleantryUnexpungeAndComputePrimitive(float key, @NonNull it.unimi.dsi.fastutil.floats.Float2ObjectFunction<? extends V> function)Attempts to unexpunge the value and compute it, if the value was expunged and returnstrue.booleantryUnexpungeAndSet(@NonNull V value)Attempts to unexpunge the value and set it, if the value was expunged and returnstrue.
-
-
-
Method Detail
-
exists
boolean exists()
Returnstrueif this entry has a value, that is neithernullor expunged. Otherwise, it returnsfalse.- Returns:
- true if a value exists, otherwise false
- Since:
- 2.0.0
-
get
@Nullable V get()
Returns the value ornullif it has been expunged.- Returns:
- the value or null if it is expunged
- Since:
- 2.0.0
-
getOr
@NonNull V getOr(@NonNull V other)
Returns the value if it exists, otherwise it returns the default value.- Parameters:
other- the default value- Returns:
- the value if present, otherwise the default value
- Since:
- 2.0.0
-
setIfAbsent
@NonNull Float2ObjectSyncMap.InsertionResult<V> setIfAbsent(@NonNull V value)
Sets the specified value if a value doesn't already exist, returning anFloat2ObjectSyncMap.InsertionResult.- Parameters:
value- the value- Returns:
- the result entry
- Since:
- 2.0.0
-
computeIfAbsent
@NonNull Float2ObjectSyncMap.InsertionResult<V> computeIfAbsent(float key, @NonNull DoubleFunction<? extends V> function)
Computes the specified value if a value doesn't already exist, returning anFloat2ObjectSyncMap.InsertionResult.- Parameters:
key- the keyfunction- the function- Returns:
- the result entry
- Since:
- 2.0.0
-
computeIfAbsentPrimitive
@NonNull Float2ObjectSyncMap.InsertionResult<V> computeIfAbsentPrimitive(float key, @NonNull it.unimi.dsi.fastutil.floats.Float2ObjectFunction<? extends V> function)
Computes the specified value if a value doesn't already exist, returning anFloat2ObjectSyncMap.InsertionResult.- Parameters:
key- the keyfunction- the function- Returns:
- the result entry
- Since:
- 2.0.0
-
computeIfPresent
@NonNull Float2ObjectSyncMap.InsertionResult<V> computeIfPresent(float key, @NonNull BiFunction<? super Float,? super V,? extends V> remappingFunction)
Computes the specified value if a value already exists, returning anFloat2ObjectSyncMap.InsertionResult.- Parameters:
key- the keyremappingFunction- the function- Returns:
- the result entry
- Since:
- 2.0.0
-
compute
@NonNull Float2ObjectSyncMap.InsertionResult<V> compute(float key, @NonNull BiFunction<? super Float,? super V,? extends V> remappingFunction)
Computes the specified value, returning anFloat2ObjectSyncMap.InsertionResult.- Parameters:
key- the keyremappingFunction- the function- Returns:
- the result entry
- Since:
- 2.0.0
-
set
void set(@NonNull V value)
Sets the value.- Parameters:
value- the value- Since:
- 2.0.0
-
replace
boolean replace(@NonNull Object compare, @Nullable V value)
Replaces the current value if it matchescomparewith the newvalueand returnstrue. Otherwise, it returnsfalse.- Parameters:
compare- The comparing valuevalue- The new value- Returns:
- true if the value was replaced, otherwise false
- Since:
- 2.0.0
-
clear
@Nullable V clear()
Clears the value.- Returns:
- the value
- Since:
- 2.0.0
-
trySet
boolean trySet(@NonNull V value)
Attempts to set the value, if the value is not expunged and returnstrue. Otherwise, it returnsfalse.- Returns:
- true if the value was set, otherwise false
- Since:
- 2.0.0
-
tryReplace
@Nullable V tryReplace(@NonNull V value)
Attempts to replace the value, if the value is not expunged ornulland returns the previous value. Otherwise, it returnsnull.- Parameters:
value- the value- Returns:
- the previous value if it exists, otherwise null
- Since:
- 2.0.0
-
tryExpunge
boolean tryExpunge()
Attempts to expunge the value, if the value isnulland returnstrue. Otherwise, it returnsfalse.- Returns:
- true if the value was expunged, otherwise false
- Since:
- 2.0.0
-
tryUnexpungeAndSet
boolean tryUnexpungeAndSet(@NonNull V value)
Attempts to unexpunge the value and set it, if the value was expunged and returnstrue. Otherwise, it returnsfalse.- Parameters:
value- the value- Returns:
- true if the value was unexpunged, otherwise false
- Since:
- 2.0.0
-
tryUnexpungeAndCompute
boolean tryUnexpungeAndCompute(float key, @NonNull DoubleFunction<? extends V> function)Attempts to unexpunge the value and compute it, if the value was expunged and returnstrue. Otherwise, it returnsfalse.- Parameters:
key- the keyfunction- the function- Returns:
- true if the value was unexpunged, otherwise false
- Since:
- 2.0.0
-
tryUnexpungeAndComputePrimitive
boolean tryUnexpungeAndComputePrimitive(float key, @NonNull it.unimi.dsi.fastutil.floats.Float2ObjectFunction<? extends V> function)Attempts to unexpunge the value and compute it, if the value was expunged and returnstrue. Otherwise, it returnsfalse.- Parameters:
key- the keyfunction- the function- Returns:
- true if the value was unexpunged, otherwise false
- Since:
- 2.0.0
-
tryUnexpungeAndCompute
boolean tryUnexpungeAndCompute(float key, @NonNull BiFunction<? super Float,? super V,? extends V> remappingFunction)Attempts to unexpunge the value and compute it, if the value was expunged and returnstrue. Otherwise, it returnsfalse.- Parameters:
key- the keyremappingFunction- the remapping function- Returns:
- true if the value was unexpunged, otherwise false
- Since:
- 2.0.0
-
-