Packages

class LRU[KeyType, ValueType] extends LRUMap[KeyType, ValueType]

LRU Cache wrapping org.apache.commons.collections.map.LRUMap

Linear Supertypes
LRUMap[KeyType, ValueType], LinkedListElem[KeyType, ValueType], AnyRef, Any
Ordering
  1. Alphabetic
  2. By Inheritance
Inherited
  1. LRU
  2. LRUMap
  3. LinkedListElem
  4. AnyRef
  5. Any
  1. Hide All
  2. Show All
Visibility
  1. Public
  2. All

Instance Constructors

  1. new LRU(size: Int)
  2. new LRU(size: Int, loadFactor: Box[Float])

    size

    the maximum number of Elements allowed in the LRU map

    loadFactor

    the Load Factor to construct our LRU with.

Value Members

  1. final def !=(arg0: Any): Boolean
    Definition Classes
    AnyRef → Any
  2. final def ##(): Int
    Definition Classes
    AnyRef → Any
  3. def -(key: KeyType): Unit

    Remove the given key and its associated value from the map.

    Remove the given key and its associated value from the map.

    Definition Classes
    LRUMap
  4. final def ==(arg0: Any): Boolean
    Definition Classes
    AnyRef → Any
  5. def apply(key: KeyType): ValueType

    Unsafe version of get.

    Unsafe version of get.

    Definition Classes
    LRUMap
    Exceptions thrown

    NullPointerException If the key does not exist in the map. Use get instead to get a safe Box result that can be checked for existence, or use contains before calling this.

  6. final def asInstanceOf[T0]: T0
    Definition Classes
    Any
  7. def canExpire(k: KeyType, v: ValueType): Boolean

    Override this method to implement a test to see if a particular element can be expired from the cache.

    Override this method to implement a test to see if a particular element can be expired from the cache.

    Attributes
    protected
    Definition Classes
    LRUMap
  8. def clone(): AnyRef
    Attributes
    protected[java.lang]
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  9. def contains(key: KeyType): Boolean

    Check if the given key exists in the map.

    Check if the given key exists in the map. A key may not be in the map either if it was never added or if it has been expired.

    Definition Classes
    LRUMap
  10. def elements: Iterator[(KeyType, ValueType)]
    Definition Classes
    LRUMap
  11. final def eq(arg0: AnyRef): Boolean
    Definition Classes
    AnyRef
  12. def equals(arg0: Any): Boolean
    Definition Classes
    AnyRef → Any
  13. def expired(key: KeyType, value: ValueType): Unit

    Called when a key/value pair is removed, before the expiredFunc.

    Called when a key/value pair is removed, before the expiredFunc.

    Does nothing by default, override for custom functionality.

    Attributes
    protected
    Definition Classes
    LRUMap
  14. def finalize(): Unit
    Attributes
    protected[java.lang]
    Definition Classes
    AnyRef
    Annotations
    @throws( classOf[java.lang.Throwable] )
  15. def get(key: KeyType): Box[ValueType]

    Fetches the given key, returning Empty if the key does not exist in the map.

    Fetches the given key, returning Empty if the key does not exist in the map. A key may not be in the map either if it was never added or if it has been expired.

    Accessing a key this way will mark its value as most-recently-used.

    Definition Classes
    LRUMap
  16. final def getClass(): Class[_]
    Definition Classes
    AnyRef → Any
  17. def hashCode(): Int
    Definition Classes
    AnyRef → Any
  18. final def isInstanceOf[T0]: Boolean
    Definition Classes
    Any
  19. def keys: List[KeyType]
    Definition Classes
    LRUMap
  20. def maxSize: Int
    Definition Classes
    LRUMap
  21. final def ne(arg0: AnyRef): Boolean
    Definition Classes
    AnyRef
  22. final def notify(): Unit
    Definition Classes
    AnyRef
  23. final def notifyAll(): Unit
    Definition Classes
    AnyRef
  24. def remove(key: KeyType): Unit

    Alias for -.

    Alias for -.

    Definition Classes
    LRUMap
  25. def size: Int
    Definition Classes
    LRUMap
  26. final def synchronized[T0](arg0: ⇒ T0): T0
    Definition Classes
    AnyRef
  27. def toString(): String
    Definition Classes
    AnyRef → Any
  28. def update(key: KeyType, value: ValueType): Unit

    Set the value for the given key in the map.

    Set the value for the given key in the map.

    Marks the given value as the most recently used, and, if this key is new in the map and the map has grown beyond the specifiex maxSize, evicts the least-recently-used entries.

    Definition Classes
    LRUMap
  29. def updateMaxSize(newMaxSize: Int): Unit

    Updates the LRUMap's current max size to newMaxSize, evicting the oldest entries if the size has shrunk.

    Updates the LRUMap's current max size to newMaxSize, evicting the oldest entries if the size has shrunk.

    Definition Classes
    LRUMap
  30. final def wait(): Unit
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  31. final def wait(arg0: Long, arg1: Int): Unit
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  32. final def wait(arg0: Long): Unit
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )

Inherited from LRUMap[KeyType, ValueType]

Inherited from LinkedListElem[KeyType, ValueType]

Inherited from AnyRef

Inherited from Any

Ungrouped