class SimpleCache[A, B] extends Cache[A, B]
A simple, thread-safe Cache
implementation based on trie maps.
Operations are atomic and allow concurrent access.
Once in the cache, values do not expire and are never released,
making this implementation not recommended when memory efficiency is of concern.
- 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
- Alphabetic
- By Inheritance
- SimpleCache
- Cache
- AnyRef
- Any
- by any2stringadd
- by StringFormat
- by Ensuring
- by ArrowAssoc
- Hide All
- Show All
- Public
- All
Instance Constructors
- new SimpleCache()
Value Members
-
final
def
!=(arg0: Any): Boolean
- Definition Classes
- AnyRef → Any
-
final
def
##(): Int
- Definition Classes
- AnyRef → Any
-
def
+(other: String): String
- Implicit
- This member is added by an implicit conversion from SimpleCache[A, B] to any2stringadd[SimpleCache[A, B]] performed by method any2stringadd in scala.Predef.
- Definition Classes
- any2stringadd
-
def
->[B](y: B): (SimpleCache[A, B], B)
- Implicit
- This member is added by an implicit conversion from SimpleCache[A, B] to ArrowAssoc[SimpleCache[A, B]] performed by method ArrowAssoc in scala.Predef.
- Definition Classes
- ArrowAssoc
- Annotations
- @inline()
-
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: (SimpleCache[A, B]) ⇒ Boolean, msg: ⇒ Any): SimpleCache[A, B]
- Implicit
- This member is added by an implicit conversion from SimpleCache[A, B] to Ensuring[SimpleCache[A, B]] performed by method Ensuring in scala.Predef.
- Definition Classes
- Ensuring
-
def
ensuring(cond: (SimpleCache[A, B]) ⇒ Boolean): SimpleCache[A, B]
- Implicit
- This member is added by an implicit conversion from SimpleCache[A, B] to Ensuring[SimpleCache[A, B]] performed by method Ensuring in scala.Predef.
- Definition Classes
- Ensuring
-
def
ensuring(cond: Boolean, msg: ⇒ Any): SimpleCache[A, B]
- Implicit
- This member is added by an implicit conversion from SimpleCache[A, B] to Ensuring[SimpleCache[A, B]] performed by method Ensuring in scala.Predef.
- Definition Classes
- Ensuring
-
def
ensuring(cond: Boolean): SimpleCache[A, B]
- Implicit
- This member is added by an implicit conversion from SimpleCache[A, B] to Ensuring[SimpleCache[A, B]] performed by method Ensuring in scala.Predef.
- Definition Classes
- Ensuring
-
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
- Implicit
- This member is added by an implicit conversion from SimpleCache[A, B] to StringFormat[SimpleCache[A, B]] performed by method StringFormat in scala.Predef.
- Definition Classes
- StringFormat
- Annotations
- @inline()
-
final
def
getClass(): Class[_]
- Definition Classes
- AnyRef → Any
- Annotations
- @native()
-
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
- Definition Classes
- SimpleCache → Cache
-
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()
-
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
- Definition Classes
- SimpleCache → Cache
-
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): (SimpleCache[A, B], B)
- Implicit
- This member is added by an implicit conversion from SimpleCache[A, B] to ArrowAssoc[SimpleCache[A, B]] performed by method ArrowAssoc in scala.Predef.
- Definition Classes
- ArrowAssoc