Package org.apache.sis.util.collection
Class Cache.ReplaceAdapter
java.lang.Object
org.apache.sis.util.collection.Cache.ReplaceAdapter
- All Implemented Interfaces:
BiFunction<K,
Object, Object>
A callback for
Cache.map
which forwards the calls to the remapping
function provided by user.
Before to forward the calls, ReplaceAdapter
verifies if the value is under computation. If yes, then
this adapter blocks until the value is available for forwarding it to the user.-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate Cache.Deferred<K,
V> The new values for which to send notifications.private final BiFunction<? super K,
? super V, ? extends V> The user-providing function. -
Constructor Summary
ConstructorsConstructorDescriptionReplaceAdapter
(BiFunction<? super K, ? super V, ? extends V> remapping) Creates a new adapter for the given user-provided function. -
Method Summary
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface java.util.function.BiFunction
andThen
-
Field Details
-
changes
The new values for which to send notifications. -
remapping
The user-providing function.
-
-
Constructor Details
-
ReplaceAdapter
ReplaceAdapter(BiFunction<? super K, ? super V, ? extends V> remapping) Creates a new adapter for the given user-provided function.
-
-
Method Details