Class ResizeableBuffer<T>
- Namespace
- AlgorithmsSW.Buffer
- Assembly
- AlgorithmsSW.dll
A buffer whose capacity can be changed.
public class ResizeableBuffer<T> : IBuffer<T?>, IEnumerable<T?>, IEnumerable
Type Parameters
T
The type of elements in the buffer.
- Inheritance
-
ResizeableBuffer<T>
- Implements
-
IBuffer<T>IEnumerable<T>
- Inherited Members
- Extension Methods
Constructors
ResizeableBuffer(int)
A buffer whose capacity can be changed.
public ResizeableBuffer(int capacity)
Parameters
capacity
intThe number of elements the buffer can retain.
Properties
Capacity
Gets the maximum number of elements the buffer can hold.
public int Capacity { get; }
Property Value
Count
Gets the current number of elements in the buffer.
public int Count { get; }
Property Value
First
Gets the first element in the buffer.
public T? First { get; }
Property Value
- T
Last
Gets the last element in the buffer.
public T? Last { get; }
Property Value
- T
Methods
Clear()
Clears all items from the buffer.
public void Clear()
GetEnumerator()
Returns an enumerator that iterates through the collection.
public IEnumerator<T?> GetEnumerator()
Returns
- IEnumerator<T>
An enumerator that can be used to iterate through the collection.
Insert(T?)
Inserts an item into the buffer.
public void Insert(T? item)
Parameters
item
TThe item to insert into the buffer.
Resize(int)
public void Resize(int newCapacity)
Parameters
newCapacity
int