trait Cache[K, V] extends AnyRef
- Annotations
- @ApiMayChange() @DoNotInherit()
- Source
- Cache.java
- Alphabetic
- By Inheritance
- Cache
- AnyRef
- Any
- by any2stringadd
- by StringFormat
- by Ensuring
- by ArrowAssoc
- Hide All
- Show All
- Public
- Protected
Abstract Value Members
- abstract def clear(): Unit
Clears the cache by removing all entries.
- 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>
. - 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).
- 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.
- 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
- 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. - abstract def remove(key: K): Unit
Removes the cache item for the given key.
- 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).
Concrete Value Members
- final def !=(arg0: Any): Boolean
- Definition Classes
- AnyRef → Any
- final def ##: Int
- Definition Classes
- AnyRef → Any
- def +(other: String): String
- def ->[B](y: B): (Cache[K, V], B)
- final def ==(arg0: Any): Boolean
- Definition Classes
- AnyRef → Any
- final def asInstanceOf[T0]: T0
- Definition Classes
- Any
- def clone(): AnyRef
- Attributes
- protected[lang]
- Definition Classes
- AnyRef
- Annotations
- @throws(classOf[java.lang.CloneNotSupportedException]) @HotSpotIntrinsicCandidate() @native()
- def ensuring(cond: (Cache[K, V]) => Boolean, msg: => Any): Cache[K, V]
- def ensuring(cond: (Cache[K, V]) => Boolean): Cache[K, V]
- def ensuring(cond: Boolean, msg: => Any): Cache[K, V]
- def ensuring(cond: Boolean): Cache[K, V]
- final def eq(arg0: AnyRef): Boolean
- Definition Classes
- AnyRef
- def equals(arg0: AnyRef): Boolean
- Definition Classes
- AnyRef → Any
- final def getClass(): Class[_ <: AnyRef]
- Definition Classes
- AnyRef → Any
- Annotations
- @HotSpotIntrinsicCandidate() @native()
- def hashCode(): Int
- Definition Classes
- AnyRef → Any
- Annotations
- @HotSpotIntrinsicCandidate() @native()
- 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
- @HotSpotIntrinsicCandidate() @native()
- final def notifyAll(): Unit
- Definition Classes
- AnyRef
- Annotations
- @HotSpotIntrinsicCandidate() @native()
- final def synchronized[T0](arg0: => T0): T0
- Definition Classes
- AnyRef
- def toString(): String
- Definition Classes
- AnyRef → Any
- final def wait(arg0: Long, arg1: Int): Unit
- Definition Classes
- AnyRef
- Annotations
- @throws(classOf[java.lang.InterruptedException])
- final def wait(arg0: Long): Unit
- Definition Classes
- AnyRef
- Annotations
- @throws(classOf[java.lang.InterruptedException]) @native()
- final def wait(): Unit
- Definition Classes
- AnyRef
- Annotations
- @throws(classOf[java.lang.InterruptedException])
Deprecated Value Members
- def finalize(): Unit
- Attributes
- protected[lang]
- Definition Classes
- AnyRef
- Annotations
- @throws(classOf[java.lang.Throwable]) @Deprecated
- Deprecated
(Since version 9)
- def formatted(fmtstr: String): String
- Implicit
- This member is added by an implicit conversion from Cache[K, V] toStringFormat[Cache[K, V]] performed by method StringFormat in scala.Predef.
- Definition Classes
- StringFormat
- Annotations
- @deprecated @inline()
- Deprecated
(Since version 2.12.16) Use
formatString.format(value)
instead ofvalue.formatted(formatString)
, or use thef""
string interpolator. In Java 15 and later,formatted
resolves to the new method in String which has reversed parameters.
- def →[B](y: B): (Cache[K, V], B)
- Implicit
- This member is added by an implicit conversion from Cache[K, V] toArrowAssoc[Cache[K, V]] performed by method ArrowAssoc in scala.Predef.
- Definition Classes
- ArrowAssoc
- Annotations
- @deprecated
- Deprecated
(Since version 2.13.0) Use
->
instead. If you still wish to display it as one character, consider using a font with programming ligatures such as Fira Code.