| Constructor and Description |
|---|
CacheGuava(int size) |
| Modifier and Type | Method and Description |
|---|---|
void |
clear() |
boolean |
containsKey(K key)
Does the cache contain the key?
|
V |
getIfPresent(K key)
Get from cache - or return null.
|
V |
getOrFill(K key,
Callable<V> filler)
Get from cache, of not present, call the
Callable
to try to fill the cache. |
boolean |
isEmpty() |
Iterator<K> |
keys()
Iterate over all keys.
|
void |
put(K key,
V thing)
Insert into the cache
|
void |
remove(K key)
Remove from cache - return true if key referenced an entry
|
void |
setDropHandler(BiConsumer<K,V> dropHandler)
Register a callback - called when an object is dropped from the cache (optional operation)
|
long |
size()
Current size of cache
|
org.apache.jena.ext.com.google.common.cache.CacheStats |
stats() |
public V getOrFill(K key, Callable<V> filler)
CacheCallable
to try to fill the cache. This operation should be atomic.public V getIfPresent(K key)
CachegetIfPresent in interface Cache<K,V>public boolean containsKey(K key)
CachecontainsKey in interface Cache<K,V>public void remove(K key)
Cachepublic Iterator<K> keys()
Cachepublic long size()
Cachepublic void setDropHandler(BiConsumer<K,V> dropHandler)
CachesetDropHandler in interface Cache<K,V>public org.apache.jena.ext.com.google.common.cache.CacheStats stats()
Licenced under the Apache License, Version 2.0