C# Class Caching.LRUCache

LRU cache that internally uses tuples.
Afficher le fichier Open project: jchristn/Caching Class Usage Examples

Méthodes publiques

Свойство Type Description
Debug bool

Private Properties

Свойство Type Description

Méthodes publiques

Méthode Description
AddReplace ( string key, object val ) : bool

Add or replace a key's value in the cache.

Clear ( ) : void

Clear the cache.

Count ( ) : int

Retrieve the current number of entries in the cache.

FirstUsed ( ) : string

Retrieve the key of the first used entry in the cache.

Get ( string key ) : object

Retrieve a key's value from the cache.

LRUCache ( int capacity, int evictCount, bool debug ) : System

Initialize the cache.

LastUsed ( ) : string

Retrieve the key of the last used entry in the cache.

Newest ( ) : string

Retrieve the key of the newest entry in the cache.

Oldest ( ) : string

Retrieve the key of the oldest entry in the cache.

Remove ( string key ) : bool

Remove a key from the cache.

Method Details

AddReplace() public méthode

Add or replace a key's value in the cache.
public AddReplace ( string key, object val ) : bool
key string The key.
val object The value associated with the key.
Résultat bool

Clear() public méthode

Clear the cache.
public Clear ( ) : void
Résultat void

Count() public méthode

Retrieve the current number of entries in the cache.
public Count ( ) : int
Résultat int

FirstUsed() public méthode

Retrieve the key of the first used entry in the cache.
public FirstUsed ( ) : string
Résultat string

Get() public méthode

Retrieve a key's value from the cache.
public Get ( string key ) : object
key string The key associated with the data you wish to retrieve.
Résultat object

LRUCache() public méthode

Initialize the cache.
public LRUCache ( int capacity, int evictCount, bool debug ) : System
capacity int Maximum number of entries.
evictCount int Number to evict when capacity is reached.
debug bool Enable or disable console debugging.
Résultat System

LastUsed() public méthode

Retrieve the key of the last used entry in the cache.
public LastUsed ( ) : string
Résultat string

Newest() public méthode

Retrieve the key of the newest entry in the cache.
public Newest ( ) : string
Résultat string

Oldest() public méthode

Retrieve the key of the oldest entry in the cache.
public Oldest ( ) : string
Résultat string

Remove() public méthode

Remove a key from the cache.
public Remove ( string key ) : bool
key string The key.
Résultat bool

Property Details

Debug public_oe property

Enable or disable console debugging.
public bool Debug
Résultat bool