Table of Contents

Class BufferWithQueue<T>

Namespace
AlgorithmsSW.Buffer
Assembly
AlgorithmsSW.dll

Represents a buffer with a fixed capacity.

public sealed class BufferWithQueue<T> : IBuffer<T>, IEnumerable<T>, IEnumerable

Type Parameters

T

The type of elements this buffer can hold.

Inheritance
BufferWithQueue<T>
Implements
Inherited Members
Extension Methods

Constructors

BufferWithQueue(int)

Represents a buffer with a fixed capacity.

public BufferWithQueue(int capacity)

Parameters

capacity int

The capacity of this the new instance.

Properties

Capacity

Gets the maximum number of elements the buffer can hold.

public int Capacity { get; }

Property Value

int

Count

Gets the current number of elements in the buffer.

public int Count { get; }

Property Value

int

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 T

The item to insert into the buffer.