Packages

class LoadingCache[K, V] extends Cache[K, V]

Linear Supertypes
Cache[K, V], AnyRef, Any
Ordering
  1. Alphabetic
  2. By Inheritance
Inherited
  1. LoadingCache
  2. Cache
  3. AnyRef
  4. Any
  1. Hide All
  2. Show All
Visibility
  1. Public
  2. Protected

Instance Constructors

  1. new LoadingCache(underlying: benmanes.caffeine.cache.LoadingCache[K, V])

Value Members

  1. final def !=(arg0: Any): Boolean
    Definition Classes
    AnyRef → Any
  2. final def ##: Int
    Definition Classes
    AnyRef → Any
  3. final def ==(arg0: Any): Boolean
    Definition Classes
    AnyRef → Any
  4. final def asInstanceOf[T0]: T0
    Definition Classes
    Any
  5. 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

    Definition Classes
    Cache
  6. 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.

    Definition Classes
    Cache
  7. def clone(): AnyRef
    Attributes
    protected[lang]
    Definition Classes
    AnyRef
    Annotations
    @throws(classOf[java.lang.CloneNotSupportedException]) @native() @HotSpotIntrinsicCandidate()
  8. final def eq(arg0: AnyRef): Boolean
    Definition Classes
    AnyRef
  9. def equals(arg0: AnyRef): Boolean
    Definition Classes
    AnyRef → Any
  10. 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

    Definition Classes
    Cache
  11. def get(key: K): V

    Returns the value associated with key in this cache, obtaining that value from loader if necessary.

    Returns the value associated with key in this cache, obtaining that value from loader if necessary.

    If another call to this method is currently loading the value for key, this thread simply waits for that thread to finish and returns its loaded value. Note that multiple threads can concurrently load values for distinct keys.

    key

    key with which the specified value is to be associated

    returns

    the current (existing or computed) value associated with the specified key

    Exceptions thrown

    java.lang.IllegalArgumentException if the computation detectably attempts a recursive update to this cache that would otherwise never complete

    java.lang.RuntimeException or Error if the CacheLoader does so, in which case the mapping is left unestablished

    java.util.concurrent.CompletionException if a checked exception was thrown while loading the value

  12. def get(key: K, mappingFunction: (K) => V): V

    Returns the value associated with key in this cache, obtaining that value from mappingFunction if necessary.

    Returns the value associated with key in this cache, obtaining that value from mappingFunction if 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

    Definition Classes
    Cache
    Exceptions thrown

    java.lang.IllegalStateException if the computation detectably attempts a recursive update to this cache that would otherwise never complete

    java.lang.RuntimeException or Error if the mappingFunction does so, in which case the mapping is left unestablished

  13. def getAll(keys: Iterable[K]): Map[K, V]

    Returns a map of the values associated with keys, creating or retrieving those values if necessary.

    Returns a map of the values associated with keys, creating or retrieving those values if necessary. The returned map contains entries that were already cached, combined with newly loaded entries.

    keys

    the keys whose associated values are to be returned

    returns

    the mapping of keys to values for the specified keys in this cache

    Exceptions thrown

    java.lang.RuntimeException or Error if the loader does so

    java.util.concurrent.CompletionException if a checked exception was thrown while loading the value

  14. def getAll(keys: Iterable[K], mappingFunction: (Iterable[K]) => Map[K, V]): Map[K, V]

    Returns the future of a map of the values associated with keys, creating or retrieving those values if necessary.

    Returns the future of a map of the values associated with keys, creating or retrieving those values if necessary. The returned map contains entries that were already cached, combined with newly loaded entries.

    A single request to the mappingFunction is performed for all keys which are not already present in the cache.

    keys

    the keys whose associated values are to be returned

    mappingFunction

    the function to compute the values

    returns

    an unmodifiable mapping of keys to values for the specified keys in this cache

    Definition Classes
    Cache
    Exceptions thrown

    java.lang.RuntimeException or Error if the mappingFunction does so, in which case the mapping is left unestablished

  15. def getAllPresent(keys: Iterable[K]): Map[K, V]

    Returns a map of the values associated with keys in this cache.

    Returns a map of the values associated with keys in 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

    Definition Classes
    Cache
  16. final def getClass(): Class[_ <: AnyRef]
    Definition Classes
    AnyRef → Any
    Annotations
    @native() @HotSpotIntrinsicCandidate()
  17. def getIfPresent(key: K): Option[V]

    Returns the value associated with key in this cache, or None if there is no cached value for key.

    Returns the value associated with key in this cache, or None if there is no cached value for key.

    key

    key whose associated value is to be returned

    returns

    an option value containing the value to which the specified key is mapped, or None if this map contains no mapping for the key

    Definition Classes
    Cache
  18. def hashCode(): Int
    Definition Classes
    AnyRef → Any
    Annotations
    @native() @HotSpotIntrinsicCandidate()
  19. 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

    Definition Classes
    Cache
  20. def invalidateAll(): Unit

    Discards all entries in the cache.

    Discards all entries in the cache.

    Definition Classes
    Cache
  21. 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

    Definition Classes
    Cache
  22. final def isInstanceOf[T0]: Boolean
    Definition Classes
    Any
  23. final def ne(arg0: AnyRef): Boolean
    Definition Classes
    AnyRef
  24. final def notify(): Unit
    Definition Classes
    AnyRef
    Annotations
    @native() @HotSpotIntrinsicCandidate()
  25. final def notifyAll(): Unit
    Definition Classes
    AnyRef
    Annotations
    @native() @HotSpotIntrinsicCandidate()
  26. 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

    Definition Classes
    Cache
  27. def put(key: K, value: V): Unit

    Associates value with key in this cache.

    Associates value with key in this cache. If the cache previously contained a value associated with key, the old value is replaced by value.

    key

    key with which the specified value is to be associated

    value

    value to be associated with the specified key

    Definition Classes
    Cache
  28. 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

    Definition Classes
    Cache
  29. def refresh(key: K): Future[V]

    Loads a new value for the key, asynchronously.

    Loads a new value for the key, asynchronously. While the new value is loading the previous value (if any) will continue to be returned by get(key) unless it is evicted.

    key

    key with which a value may be associated

  30. 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

    Definition Classes
    Cache
  31. final def synchronized[T0](arg0: => T0): T0
    Definition Classes
    AnyRef
  32. def toString(): String
    Definition Classes
    LoadingCacheCache → AnyRef → Any
  33. val underlying: benmanes.caffeine.cache.LoadingCache[K, V]
    Definition Classes
    LoadingCacheCache
  34. final def wait(arg0: Long, arg1: Int): Unit
    Definition Classes
    AnyRef
    Annotations
    @throws(classOf[java.lang.InterruptedException])
  35. final def wait(arg0: Long): Unit
    Definition Classes
    AnyRef
    Annotations
    @throws(classOf[java.lang.InterruptedException]) @native()
  36. final def wait(): Unit
    Definition Classes
    AnyRef
    Annotations
    @throws(classOf[java.lang.InterruptedException])

Deprecated Value Members

  1. def finalize(): Unit
    Attributes
    protected[lang]
    Definition Classes
    AnyRef
    Annotations
    @throws(classOf[java.lang.Throwable]) @Deprecated
    Deprecated

Inherited from Cache[K, V]

Inherited from AnyRef

Inherited from Any

Ungrouped