C# Class Caching.LRUCacheBTree

LRU cache that internally uses a BTree (refer to CSharpTest.Net).
Datei anzeigen Open project: jchristn/Caching Class Usage Examples

Public Properties

Property Type Description
Debug bool

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.

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.

LRUCacheBTree ( 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 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

FirstUsed() public method

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

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

LRUCacheBTree() public method

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

LastUsed() public method

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

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