Packages

trait Cache[K, V] extends AnyRef

Annotations
@ApiMayChange() @DoNotInherit()
Source
Cache.java
Linear Supertypes
Known Subclasses
Type Hierarchy
Ordering
  1. Alphabetic
  2. By Inheritance
Inherited
  1. Cache
  2. AnyRef
  3. Any
Implicitly
  1. by any2stringadd
  2. by StringFormat
  3. by Ensuring
  4. by ArrowAssoc
  1. Hide All
  2. Show All
Visibility
  1. Public
  2. Protected

Abstract Value Members

  1. abstract def clear(): Unit

    Clears the cache by removing all entries.

  2. abstract def getFuture(key: K, genValue: Creator[CompletionStage[V]]): CompletionStage[V]

    Returns either the cached CompletionStage for the given key or evaluates the given value generating function producing a CompletionStage<V>.

  3. abstract def getKeys(): Set[K]

    Returns the set of keys in the cache, in no particular order Should return in roughly constant time.

    Returns the set of keys in the cache, in no particular order Should return in roughly constant time. Note that this number might not reflect the exact keys of active, unexpired cache entries, since expired entries are only evicted upon next access (or by being thrown out by a capacity constraint).

  4. abstract def getOptional(key: K): Optional[CompletionStage[V]]

    Retrieves the CompletionStage instance that is currently in the cache for the given key.

    Retrieves the CompletionStage instance that is currently in the cache for the given key. Returns None if the key has no corresponding cache entry.

  5. abstract def getOrCreateStrict(key: K, block: Creator[V]): CompletionStage[V]

    Returns either the cached CompletionStage for the given key or the given value as a CompletionStage

  6. abstract def getOrFulfil(key: K, f: Procedure[CompletableFuture[V]]): CompletionStage[V]

    Returns either the cached CompletionStage for the key, or evaluates the given function which should lead to eventual completion of the completable future.

  7. abstract def remove(key: K): Unit

    Removes the cache item for the given key.

  8. abstract def size(): Int

    Returns the upper bound for the number of currently cached entries.

    Returns the upper bound for the number of currently cached entries. Note that this number might not reflect the exact number of active, unexpired cache entries, since expired entries are only evicted upon next access (or by being thrown out by a capacity constraint).