LimitList<T> Class

A list that holds at most LimitList<T>.Capacity items, and drops the item at the other end when an item is added to a full list.

public sealed class LimitList<T> : ICollection<T>, IEnumerable<T>, IList<T>, IReadOnlyCollection<T>, IReadOnlyList<T>, IEnumerable

Type parameters

T
Implements

Nested types

NameDescription
LimitList<T>.Enumerator

Constructors

NameDescription
LimitList(int)

LimitList(int)

LimitList.cs
public LimitList(int maximumCount)

Parameters

maximumCount int

No documentation is available.

Properties

NameDescription
Capacity
Count
System.Collections.Generic.ICollection<T>.IsReadOnly

Capacity

LimitList.cs
public int Capacity { get; }

Property value

int

No documentation is available.

public int Count { get; }

Property value

int

No documentation is available.

System.Collections.Generic.ICollection<T>.IsReadOnly

LimitList.cs
bool ICollection<T>.IsReadOnly { get; }

Property value

bool

No documentation is available.

Indexers

NameDescription
this[int]Gets or sets the item at the specified index. Setting the item at index LimitList<T>.Count adds the item at the end of the list.

this[int]

LimitList.cs

Gets or sets the item at the specified index. Setting the item at index LimitList<T>.Count adds the item at the end of the list.

public T this[int index] { get; set; }

Parameters

index int

Property value

T

Methods

NameDescription
AddFirst(T)Adds an item at the beginning of the list. When the list is full, the last item is removed.
AddLast(T)Adds an item at the end of the list. When the list is full, the first item is removed.
Clear()
Contains(T)
CopyTo(T[], int)
GetEnumerator()
IndexOf(T)
Insert(int, T)Inserts an item at the specified index. When the list is full, inserting at index LimitList<T>.Count removes the first item, and inserting at any other index removes the last item.
Remove(T)
RemoveAt(int)
RemoveFirst()
RemoveLast()
System.Collections.Generic.ICollection<T>.Add(T)
System.Collections.Generic.IEnumerable<T>.GetEnumerator()
System.Collections.IEnumerable.GetEnumerator()

AddFirst(T)

LimitList.cs

Adds an item at the beginning of the list. When the list is full, the last item is removed.

public void AddFirst(T value)

Parameters

value T

AddLast(T)

LimitList.cs

Adds an item at the end of the list. When the list is full, the first item is removed.

public void AddLast(T value)

Parameters

value T
public void Clear()

No documentation is available.

Contains(T)

LimitList.cs
public bool Contains(T item)

Parameters

item T

Returns

bool

No documentation is available.

CopyTo(T[], int)

LimitList.cs
public void CopyTo(T[] array, int arrayIndex)

Parameters

array T[]
arrayIndex int

No documentation is available.

GetEnumerator()

LimitList.cs
public LimitList<T>.Enumerator GetEnumerator()

No documentation is available.

IndexOf(T)

LimitList.cs
public int IndexOf(T item)

Parameters

item T

Returns

int

No documentation is available.

Insert(int, T)

LimitList.cs

Inserts an item at the specified index. When the list is full, inserting at index LimitList<T>.Count removes the first item, and inserting at any other index removes the last item.

public void Insert(int index, T item)

Parameters

index int
item T

Remove(T)

LimitList.cs
public bool Remove(T item)

Parameters

item T

Returns

bool

No documentation is available.

RemoveAt(int)

LimitList.cs
public void RemoveAt(int index)

Parameters

index int

No documentation is available.

RemoveFirst()

LimitList.cs
public void RemoveFirst()

No documentation is available.

RemoveLast()

LimitList.cs
public void RemoveLast()

No documentation is available.

System.Collections.Generic.ICollection<T>.Add(T)

LimitList.cs
void ICollection<T>.Add(T item)

Parameters

item T

No documentation is available.

System.Collections.Generic.IEnumerable<T>.GetEnumerator()

LimitList.cs
IEnumerator<T> IEnumerable<T>.GetEnumerator()

No documentation is available.

System.Collections.IEnumerable.GetEnumerator()

LimitList.cs
IEnumerator IEnumerable.GetEnumerator()

No documentation is available.