Table of Contents

Class OptimizedCapacity2Buffer<T>

Namespace
AlgorithmsSW.Buffer
Assembly
AlgorithmsSW.dll

Represents a buffer with a fixed capacity of two items.

public sealed class OptimizedCapacity2Buffer<T> : IBuffer<T?>, IEnumerable<T?>, IEnumerable, IPair<T>

Type Parameters

T

The type of items contained in the buffer.

Inheritance
OptimizedCapacity2Buffer<T>
Implements
Inherited Members
Extension Methods

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

Represents a generic buffer interface.

public T? First { get; }

Property Value

T

HasPreviousValue

Gets a value indicating whether this buffer has a previous value.

public bool HasPreviousValue { get; }

Property Value

bool

HasValue

Gets a value indicating whether this buffer has a value.

public bool HasValue { get; }

Property Value

bool

IsFull

Gets a value indicating whether the buffer is full.

public bool IsFull { get; }

Property Value

bool

Last

Represents a generic buffer interface.

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.