BoundedList<T>

public sealed class BoundedList<T>
A list with a capped capacity which throws away the oldest element when newly added elements would cause a capacity overrun. This collection is threadsafe.
T

Constructors

BoundedList

#
public BoundedList(int capacity)
capacity (int)

Properties

Capacity

#
public int Capacity { get; }
Gets the maximum capacity of this collection.

Count

#
public int Count { get; }
Gets the total number of elements currently in this collection.

Indexers

this[]

#
public T this[int index] { get; }
index (int)

Methods

Add

#
public void Add(T item)
Add a new element in the most important slot in this collection.
item (T)

MoveToFront

#
public void MoveToFront(int index)
Move the item at the given index to the front of the list.
index (int)

Remove

#
public void Remove(T item)
Remove the element at the given index.
item (T)