D
- the data typeS
- the context typepublic static class UserScaleContext.Cache<D,S extends UserScaleContext>
extends java.lang.Object
Constructor and Description |
---|
Cache(java.util.function.Function<? super S,? extends D> dataProvider) |
Modifier and Type | Method and Description |
---|---|
void |
clear()
Clears the cache.
|
D |
getOrProvide(S ctx)
Returns the data object from the cache if it matches the
ctx ,
otherwise provides the new data via the provider and caches it. |