Table of Contents

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
Inherited Members
Extension Methods

Constructors

ResizeableBuffer(int)

A buffer whose capacity can be changed.

public ResizeableBuffer(int capacity)

Parameters

capacity int

The 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

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.

Resize(int)

public void Resize(int newCapacity)

Parameters

newCapacity int