Table of Contents

Class FixedCapacityQueue<T>

Namespace
AlgorithmsSW.Queue
Assembly
AlgorithmsSW.dll

A queue with a fixed capacity.

public sealed class FixedCapacityQueue<T> : IQueue<T>, IEnumerable<T>, IEnumerable

Type Parameters

T

The type of the queue's items.

Inheritance
FixedCapacityQueue<T>
Implements
Inherited Members
Extension Methods

Constructors

FixedCapacityQueue(int)

A queue with a fixed capacity.

public FixedCapacityQueue(int capacity)

Parameters

capacity int

Exceptions

ArgumentException

capacity is negative.

Properties

Capacity

Gets the capacity for this instance.

public int Capacity { get; }

Property Value

int

Exceptions

ArgumentException

capacity is negative.

Count

Gets the number of items contained in the IQueue<T>.

public int Count { get; }

Property Value

int

Exceptions

ArgumentException

capacity is negative.

IsEmpty

Gets a value indicating whether the IQueue<T> is empty.

public bool IsEmpty { get; }

Property Value

bool

Exceptions

ArgumentException

capacity is negative.

IsFull

Gets a value indicating whether the queue is full, that is Count equals Capacity.

public bool IsFull { get; }

Property Value

bool

Exceptions

ArgumentException

capacity is negative.

Peek

Gets the item at the beginning of the IQueue<T> without removing it.

public T Peek { get; }

Property Value

T

Exceptions

ArgumentException

capacity is negative.

Methods

Clear()

Removes all items from the IQueue<T>.

public void Clear()

Exceptions

ArgumentException

capacity is negative.

Dequeue()

Removes and returns the item at the beginning of the IQueue<T>.

public T Dequeue()

Returns

T

The item at the beginning of the IQueue<T>.

Exceptions

ArgumentException

capacity is negative.

Enqueue(T)

Adds an item to the end of the IQueue<T>.

public void Enqueue(T item)

Parameters

item T

The item to add to the IQueue<T>.

Exceptions

ArgumentException

capacity is negative.

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.

Exceptions

ArgumentException

capacity is negative.

GetHashCode()

Serves as the default hash function.

public override int GetHashCode()

Returns

int

A hash code for the current object.

Exceptions

ArgumentException

capacity is negative.

ToString()

Returns a string that represents the current object.

public override string ToString()

Returns

string

A string that represents the current object.

Exceptions

ArgumentException

capacity is negative.