class Cache[K, V] extends AnyRef
- Alphabetic
- By Inheritance
- Cache
- AnyRef
- Any
- Hide All
- Show All
- Public
- All
Instance Constructors
- new Cache(underlying: benmanes.caffeine.cache.Cache[K, V])
Value Members
-
final
def
!=(arg0: Any): Boolean
- Definition Classes
- AnyRef → Any
-
final
def
##(): Int
- Definition Classes
- AnyRef → Any
-
final
def
==(arg0: Any): Boolean
- Definition Classes
- AnyRef → Any
-
final
def
asInstanceOf[T0]: T0
- Definition Classes
- Any
-
def
asMap(): Map[K, V]
Returns a view of the entries stored in this cache as a thread-safe map.
Returns a view of the entries stored in this cache as a thread-safe map. Modifications made to the map directly affect the cache.
- returns
a thread-safe view of this cache
-
def
cleanUp(): Unit
Performs any pending maintenance operations needed by the cache.
Performs any pending maintenance operations needed by the cache. Exactly which activities are performed -- if any -- is implementation-dependent.
-
def
clone(): AnyRef
- Attributes
- protected[java.lang]
- Definition Classes
- AnyRef
- Annotations
- @native() @throws( ... )
-
final
def
eq(arg0: AnyRef): Boolean
- Definition Classes
- AnyRef
-
def
equals(arg0: Any): Boolean
- Definition Classes
- AnyRef → Any
-
def
estimatedSize(): Long
Returns the approximate number of entries in this cache.
Returns the approximate number of entries in this cache.
- returns
the estimated number of mappings
-
def
finalize(): Unit
- Attributes
- protected[java.lang]
- Definition Classes
- AnyRef
- Annotations
- @throws( classOf[java.lang.Throwable] )
-
def
get(key: K, mappingFunction: (K) ⇒ V): V
Returns the value associated with
keyin this cache, obtaining that value frommappingFunctionif necessary.Returns the value associated with
keyin this cache, obtaining that value frommappingFunctionif necessary. This method provides a simple substitute for the conventional "if cached, return; otherwise create, cache and return" pattern.- key
key with which the specified value is to be associated
- mappingFunction
the function to compute a value
- returns
the current (existing or computed) value associated with the specified key
- Exceptions thrown
java.lang.IllegalStateExceptionif the computation detectably attempts a recursive update to this cache that would otherwise never completejava.lang.RuntimeExceptionor Error if the mappingFunction does so, in which case the mapping is left unestablished
-
def
getAllPresent(keys: Iterable[K]): Map[K, V]
Returns a map of the values associated with
keysin this cache.Returns a map of the values associated with
keysin this cache. The returned map will only contain entries which are already present in the cache.- keys
the keys whose associated values are to be returned
- returns
the mapping of keys to values for the specified keys found in this cache
-
final
def
getClass(): Class[_]
- Definition Classes
- AnyRef → Any
- Annotations
- @native()
-
def
getIfPresent(key: K): Option[V]
Returns the value associated with
keyin this cache, orNoneif there is no cached value forkey.Returns the value associated with
keyin this cache, orNoneif there is no cached value forkey.- key
key whose associated value is to be returned
- returns
an option value containing the value to which the specified key is mapped, or
Noneif this map contains no mapping for the key
-
def
hashCode(): Int
- Definition Classes
- AnyRef → Any
- Annotations
- @native()
-
def
invalidate(key: K): Unit
Discards any cached value for key
key.Discards any cached value for key
key.- key
key whose mapping is to be removed from the cache
-
def
invalidateAll(): Unit
Discards all entries in the cache.
-
def
invalidateAll(keys: Iterable[K]): Unit
Discards any cached values for keys
keys.Discards any cached values for keys
keys.- keys
the keys whose associated values are to be removed
-
final
def
isInstanceOf[T0]: Boolean
- Definition Classes
- Any
-
final
def
ne(arg0: AnyRef): Boolean
- Definition Classes
- AnyRef
-
final
def
notify(): Unit
- Definition Classes
- AnyRef
- Annotations
- @native()
-
final
def
notifyAll(): Unit
- Definition Classes
- AnyRef
- Annotations
- @native()
-
def
policy(): Policy[K, V]
Returns access to inspect and perform low-level operations on this cache based on its runtime characteristics.
Returns access to inspect and perform low-level operations on this cache based on its runtime characteristics. These operations are optional and dependent on how the cache was constructed and what abilities the implementation exposes.
- returns
access to inspect and perform advanced operations based on the cache's characteristics
-
def
put(key: K, value: V): Unit
Associates
valuewithkeyin this cache.Associates
valuewithkeyin this cache. If the cache previously contained a value associated withkey, the old value is replaced byvalue.- key
key with which the specified value is to be associated
- value
value to be associated with the specified key
-
def
putAll(map: Map[K, V]): Unit
Copies all of the mappings from the specified map to the cache.
Copies all of the mappings from the specified map to the cache.
- map
mappings to be stored in this cache
-
def
stats(): CacheStats
Returns a current snapshot of this cache's cumulative statistics.
Returns a current snapshot of this cache's cumulative statistics. All statistics are initialized to zero, and are monotonically increasing over the lifetime of the cache.
- returns
the current snapshot of the statistics of this cache
-
final
def
synchronized[T0](arg0: ⇒ T0): T0
- Definition Classes
- AnyRef
-
def
toString(): String
- Definition Classes
- Cache → AnyRef → Any
- val underlying: benmanes.caffeine.cache.Cache[K, V]
-
final
def
wait(): Unit
- Definition Classes
- AnyRef
- Annotations
- @throws( ... )
-
final
def
wait(arg0: Long, arg1: Int): Unit
- Definition Classes
- AnyRef
- Annotations
- @throws( ... )
-
final
def
wait(arg0: Long): Unit
- Definition Classes
- AnyRef
- Annotations
- @native() @throws( ... )