C# Класс SharpNeat.Utility.KeyedCircularBuffer

A generic circular buffer of KeyValuePairs. The values are retrievable by their key. Old key-value pairs are overwritten when the circular buffer runs out of empty elements to place items into, as this happens the internal dictionary that maintains the lookup ability is also updated to reflect only the items in the circular buffer.
Наследование: CircularBuffer
Показать файл Открыть проект

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

Метод Описание
Clear ( ) : void

Clear the buffer.

ContainsKey ( key ) : bool

Determines whether the KeyedCircularBuffer contains the specified key.

Dequeue ( ) : V>.KeyValuePair

Remove the oldest item from the back end of the buffer and return it.

Enqueue ( key, value ) : void

Enqueue a new item. This overwrites the oldest item in the buffer if the buffer has reached capacity.

Enqueue ( KeyValuePair item ) : void

Enqueue a new item. This overwrites the oldest item in the buffer if the buffer has reached capacity.

KeyedCircularBuffer ( int capacity ) : System.Collections.Generic

Constructs a circular buffer with the specified capacity.

Pop ( ) : V>.KeyValuePair

Pop the most recently added item from the front end of the buffer and return it.

TryGetValue ( key, &value ) : bool

Gets the value associated with the specified key.

this ( key ) : V

Gets the value associated with the specified key. If the specified key is not found, a get operation throws a KeyNotFoundException.

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

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

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

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

Determines whether the KeyedCircularBuffer contains the specified key.
public ContainsKey ( key ) : bool
Результат bool

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

Remove the oldest item from the back end of the buffer and return it.
public Dequeue ( ) : V>.KeyValuePair
Результат V>.KeyValuePair

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

Enqueue a new item. This overwrites the oldest item in the buffer if the buffer has reached capacity.
public Enqueue ( key, value ) : void
Результат void

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

Enqueue a new item. This overwrites the oldest item in the buffer if the buffer has reached capacity.
public Enqueue ( KeyValuePair item ) : void
item KeyValuePair
Результат void

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

Constructs a circular buffer with the specified capacity.
public KeyedCircularBuffer ( int capacity ) : System.Collections.Generic
capacity int
Результат System.Collections.Generic

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

Pop the most recently added item from the front end of the buffer and return it.
public Pop ( ) : V>.KeyValuePair
Результат V>.KeyValuePair

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

Gets the value associated with the specified key.
public TryGetValue ( key, &value ) : bool
Результат bool

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

Gets the value associated with the specified key. If the specified key is not found, a get operation throws a KeyNotFoundException.
public this ( key ) : V
Результат V