C# 클래스 Caching.LRUCache

LRU cache that internally uses tuples.
파일 보기 프로젝트 열기: jchristn/Caching 1 사용 예제들

공개 프로퍼티들

프로퍼티 타입 설명
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.

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.

메소드 상세

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

FirstUsed() 공개 메소드

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

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

LRUCache() 공개 메소드

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.
리턴 System

LastUsed() 공개 메소드

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

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