trait Cache[A, B] extends AnyRef
Simple facade interface to abstract over cache implementation.
- A
the type of the keys used to store and retrieve values
- B
the type of the values stored in this cache
- Source
- Cache.scala
Linear Supertypes
Known Subclasses
Ordering
- Alphabetic
- By Inheritance
Inherited
- Cache
- AnyRef
- Any
Implicitly
- by any2stringadd
- by StringFormat
- by Ensuring
- by ArrowAssoc
- Hide All
- Show All
Visibility
- Public
- All
Abstract Value Members
-
abstract
def
getOrElseUpdate(key: A, op: ⇒ B): B
If
key
is already in cache, returns its associated value.If
key
is already in cache, returns its associated value. Otherwise, computes value fromop
, stores it in cache, and returns it.- key
the key to test
- op
the computation yielding the value to associate with
key
, if previously unbound- returns
the value previously associated with
key
, otherwise the result of evaluatingop
-
abstract
def
size: Int
The number of elements stored in this cache.
The number of elements stored in this cache.
- returns
the number of elements in cache
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[A, B], 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( ... ) @native()
- def ensuring(cond: (Cache[A, B]) ⇒ Boolean, msg: ⇒ Any): Cache[A, B]
- def ensuring(cond: (Cache[A, B]) ⇒ Boolean): Cache[A, B]
- def ensuring(cond: Boolean, msg: ⇒ Any): Cache[A, B]
- def ensuring(cond: Boolean): Cache[A, B]
-
final
def
eq(arg0: AnyRef): Boolean
- Definition Classes
- AnyRef
-
def
equals(arg0: Any): Boolean
- Definition Classes
- AnyRef → Any
-
def
finalize(): Unit
- Attributes
- protected[lang]
- Definition Classes
- AnyRef
- Annotations
- @throws( classOf[java.lang.Throwable] )
- def formatted(fmtstr: String): String
-
final
def
getClass(): Class[_]
- Definition Classes
- AnyRef → Any
- Annotations
- @native()
-
def
hashCode(): Int
- Definition Classes
- AnyRef → Any
- Annotations
- @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
- @native()
-
final
def
notifyAll(): Unit
- Definition Classes
- AnyRef
- Annotations
- @native()
-
final
def
synchronized[T0](arg0: ⇒ T0): T0
- Definition Classes
- AnyRef
-
def
toString(): String
- Definition Classes
- AnyRef → Any
-
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
- @throws( ... ) @native()
- def →[B](y: B): (Cache[A, B], B)