public class Cache extends Object
| Modifier and Type | Class and Description |
|---|---|
static interface |
Cache.CacheCallback<T>
Interface used to access an object when it is not found in the cache.
|
| Constructor and Description |
|---|
Cache(com.google.gwt.core.client.JavaScriptObject cacheHolder)
Creates a new cache that uses the given JavaScript object to store the cached objects.
|
| Modifier and Type | Method and Description |
|---|---|
void |
clear(boolean disable)
Clears the cache and optionally disables it.
|
<T> T |
get(String key,
Cache.CacheCallback<T> callback)
Looks up the given key in the cache and returns the associated object if the key if found.
|
public Cache(com.google.gwt.core.client.JavaScriptObject cacheHolder)
cacheHolder - the JavaScript object that holds the map with the cached objectspublic <T> T get(String key, Cache.CacheCallback<T> callback)
T - the type of the cached objectkey - the key that identifies the requested object in the cachecallback - the call-back used to retrieve the requested object when it is not found in the cachepublic void clear(boolean disable)
disable - true to disable the cache, false to enable the cacheCopyright © 2004–2016 XWiki. All rights reserved.