net.liftweb.util.KeyedCache

class KeyedCache

class KeyedCache[K, T](size : Int, loadFactor : Box[Float], cons : (K) => Box[T])

 extends ScalaObject


A simple Read-through cache. An example of using it with a ProtoUser subclass: object UserCache extends KeyedCache[Long, User](100, Full(0.75f), (id: Long) => User.find(By(User.id, id)))
author
- Steve Jenson (stevej@pobox.com)
param
loadFactor - the optional Load Factor
cons - A function that will take a value of type K and return a Box[T] populated into the cache if the return value is Full.
size - the size of the cache


Source: KeyedCache.scala(38)

 Constructors

def this(size : Int, loadFactor : Box[Float], cons : (K) => Box[T])

 Fields

cache.. val cache LRU[K, T]

 Methods

!=.. final def !=(arg0 : Object) Boolean AnyRef
!=.. final def !=(arg0 : Any) Boolean Any
==.. final def ==(arg0 : Any) Boolean Any
==.. final def ==(arg0 : Object) Boolean AnyRef
apply.. def apply(key : K)
If the cache contains a value mapped to {@code key} then return it, otherwise run cons and add that value to the cache and return it
Box[T]
asInstanceOf.. final def asInstanceOf[T0] T0 Any
clone.. protected def clone Object AnyRef
eq.. final def eq(arg0 : Object) Boolean AnyRef
equals.. def equals(arg0 : Any) Boolean AnyRef
finalize.. protected def finalize Unit AnyRef
getClass.. final def getClass Class[Any] AnyRef
hashCode.. def hashCode Int AnyRef
isInstanceOf.. final def isInstanceOf[T0] Boolean Any
ne.. final def ne(arg0 : Object) Boolean AnyRef
notify.. final def notify Unit AnyRef
notifyAll.. final def notifyAll Unit AnyRef
remove.. def remove(key : K)
Evict a value from the cache
Unit
synchronized.. final def synchronized[T0](arg0 : T0) T0 AnyRef
toString.. def toString String AnyRef
update.. def update(key : K, value : T)
Update the cache yourself with KeyedCache(1) = "hello"
Unit
wait.. final def wait(arg0 : Long, arg1 : Int) Unit AnyRef
wait.. final def wait(arg0 : Long) Unit AnyRef
wait.. final def wait Unit AnyRef
Copyright (c) 2006-2010 WorldWide Conferencing, LLC. All Rights Reserved.