C# Class Caching.FIFOCache

FIFO cache that internally uses tuples.
显示文件 Open project: jchristn/Caching Class Usage Examples

Public Properties

Property Type Description
Debug bool

Private Properties

Property Type Description

Public Methods

Method 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 method

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.
return bool

Clear() public method

Clear the cache.
public Clear ( ) : void
return void

Count() public method

Retrieve the current number of entries in the cache.
public Count ( ) : int
return int

FIFOCache() public method

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.
return System

Get() public method

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.
return object

Newest() public method

Retrieve the key of the newest entry in the cache.
public Newest ( ) : string
return string

Oldest() public method

Retrieve the key of the oldest entry in the cache.
public Oldest ( ) : string
return string

Remove() public method

Remove a key from the cache.
public Remove ( string key ) : bool
key string The key.
return bool

Property Details

Debug public_oe property

Enable or disable console debugging.
public bool Debug
return bool