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>, IEnumerableType parameters
T
Nested types
| Name | Description |
|---|---|
| LimitList<T>.Enumerator |
Constructors
| Name | Description |
|---|---|
| LimitList(int) |
LimitList(int)
LimitList.csProperties
| Name | Description |
|---|---|
| Capacity | |
| Count | |
| System.Collections.Generic.ICollection<T>.IsReadOnly |
Capacity
LimitList.csCount
LimitList.csSystem.Collections.Generic.ICollection<T>.IsReadOnly
LimitList.csIndexers
| Name | Description |
|---|---|
| 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.csGets 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; }Methods
| Name | Description |
|---|---|
| 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.csAdds an item at the beginning of the list. When the list is full, the last item is removed.
public void AddFirst(T value)Parameters
valueT
AddLast(T)
LimitList.csAdds an item at the end of the list. When the list is full, the first item is removed.
public void AddLast(T value)Parameters
valueT
Clear()
LimitList.cspublic void Clear()No documentation is available.
Contains(T)
LimitList.csCopyTo(T[], int)
LimitList.csGetEnumerator()
LimitList.csIndexOf(T)
LimitList.csInsert(int, T)
LimitList.csInserts 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.
Parameters
indexintitemT
Remove(T)
LimitList.csRemoveAt(int)
LimitList.csRemoveFirst()
LimitList.cspublic void RemoveFirst()No documentation is available.
RemoveLast()
LimitList.cspublic void RemoveLast()No documentation is available.