C# Class Caching.FIFOCache

FIFO 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.

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

Initialize the cache.

Get ( string key ) : object

Retrieve a key's value from 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

FIFOCache() public méthode

Initialize the cache.
public FIFOCache ( 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

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

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