groupcache.lru

Cache

class Cache[Key, Value] extends AnyRef

A simple LRU cache that is not safe for concurrent access.

Linear Supertypes
AnyRef, Any
Ordering
  1. Alphabetic
  2. By inheritance
Inherited
  1. Cache
  2. AnyRef
  3. Any
  1. Hide All
  2. Show all
Learn more about member selection
Visibility
  1. Public
  2. All

Instance Constructors

  1. new Cache(maxEntries: Int = 0, onEvicted: Option[(Key, Value) ⇒ Unit] = scala.None)

    maxEntries

    The maximum number of cache entries before an item is evicted. Zero means no limit.

    onEvicted

    Optional callback function that takes key/value parameters, to be executed when an entry is purged from the cache.

Value Members

  1. final def !=(arg0: AnyRef): Boolean

    Definition Classes
    AnyRef
  2. final def !=(arg0: Any): Boolean

    Definition Classes
    Any
  3. final def ##(): Int

    Definition Classes
    AnyRef → Any
  4. def +=(key: Key, value: Value): Unit

    Adds a value to the cache.

    Adds a value to the cache. If the key already exists, the entry's value is updated.

    key
    value

  5. def -=(key: Key): Unit

    Removes the entry with the given key from the cache.

    Removes the entry with the given key from the cache. Does nothing if the key does not exist in the cache.

    key

  6. final def ==(arg0: AnyRef): Boolean

    Definition Classes
    AnyRef
  7. final def ==(arg0: Any): Boolean

    Definition Classes
    Any
  8. def add(key: Key, value: Value): Unit

    Adds a value to the cache.

    Adds a value to the cache. If the key already exists, the entry's value is updated.

    key
    value

  9. final def asInstanceOf[T0]: T0

    Definition Classes
    Any
  10. def clone(): AnyRef

    Attributes
    protected[java.lang]
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  11. final def eq(arg0: AnyRef): Boolean

    Definition Classes
    AnyRef
  12. def equals(arg0: Any): Boolean

    Definition Classes
    AnyRef → Any
  13. def finalize(): Unit

    Attributes
    protected[java.lang]
    Definition Classes
    AnyRef
    Annotations
    @throws( classOf[java.lang.Throwable] )
  14. def get(key: Key): Option[Value]

    Optionally gets the key's value from the cache.

    Optionally gets the key's value from the cache.

    key
    returns

  15. final def getClass(): Class[_]

    Definition Classes
    AnyRef → Any
  16. def hashCode(): Int

    Definition Classes
    AnyRef → Any
  17. final def isInstanceOf[T0]: Boolean

    Definition Classes
    Any
  18. def itemCount: Int

    Gets the number of entries currently held in the cache.

  19. final def ne(arg0: AnyRef): Boolean

    Definition Classes
    AnyRef
  20. final def notify(): Unit

    Definition Classes
    AnyRef
  21. final def notifyAll(): Unit

    Definition Classes
    AnyRef
  22. def remove(key: Key): Unit

    Removes the entry with the given key from the cache.

    Removes the entry with the given key from the cache. Does nothing if the key does not exist in the cache.

    key

  23. def removeOldest: Unit

    Removes the oldest entry from the cache.

    Removes the oldest entry from the cache. Does nothing if the cache is empty.

  24. final def synchronized[T0](arg0: ⇒ T0): T0

    Definition Classes
    AnyRef
  25. def toString(): String

    Definition Classes
    AnyRef → Any
  26. final def wait(): Unit

    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  27. final def wait(arg0: Long, arg1: Int): Unit

    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  28. final def wait(arg0: Long): Unit

    Definition Classes
    AnyRef
    Annotations
    @throws( ... )

Inherited from AnyRef

Inherited from Any

Ungrouped