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
파일 보기 프로젝트 열기: flo-wolf/UnitySharpNEAT

공개 메소드들

메소드 설명
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