com.github.cloudfiles.core.utils

Members list

Type members

Classlikes

object LRUCache

Attributes

Companion
class
Supertypes
class Object
trait Matchable
class Any
Self type
LRUCache.type
class LRUCache[K, +V]

An implementation of a LRU cache.

An implementation of a LRU cache.

This class implements a cache with a given capacity. Instances are immutable and allow fast access to the keys they contain. When elements are added (either new elements or ones that already exist in the cache) they are put in the front of the cache; if the cache's capacity is reached, elements at the end are discarded.

The intended usage scenario is that a number of read operations is performed on an instance. Based on these operations it is determined which new elements are to be added or which ones need to be put in front. The corresponding updates are then triggered leading to a new instance.

Type parameters

K

the type of keys

V

the type of values

Value parameters

capacity

the capacity of the cache

entries

a map storing the data of the cache

lruList

a map storing LRU-related information

Attributes

Companion
object
Supertypes
class Object
trait Matchable
class Any