C# Класс Caching.FIFOCache

FIFO cache that internally uses tuples.
Показать файл Открыть проект Примеры использования класса

Открытые свойства

Свойство Тип Описание
Debug bool

Private Properties

Свойство Тип Описание

Открытые методы

Метод Описание
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.

Описание методов

AddReplace() публичный Метод

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.
Результат bool

Clear() публичный Метод

Clear the cache.
public Clear ( ) : void
Результат void

Count() публичный Метод

Retrieve the current number of entries in the cache.
public Count ( ) : int
Результат int

FIFOCache() публичный Метод

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.
Результат System

Get() публичный Метод

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.
Результат object

Newest() публичный Метод

Retrieve the key of the newest entry in the cache.
public Newest ( ) : string
Результат string

Oldest() публичный Метод

Retrieve the key of the oldest entry in the cache.
public Oldest ( ) : string
Результат string

Remove() публичный Метод

Remove a key from the cache.
public Remove ( string key ) : bool
key string The key.
Результат bool

Описание свойств

Debug публичное свойство

Enable or disable console debugging.
public bool Debug
Результат bool