Show / Hide Table of Contents

Class QueueArray<T>

Implements First-In-First-Out queue data structure using an array.

Inheritance
System.Object
QueueArray<T>
Implements
IQueue<T>
IDataStructure<T>
ISteppable<T>
System.Collections.Generic.IEnumerable<T>
DataStructure.ICountable
DataStructure.IClearable
ICloneable<QueueArray<T>>
Namespace: Towel.DataStructures
Assembly: Towel.dll
Syntax
public class QueueArray<T> : object, IQueue<T>, IDataStructure<T>, ISteppable<T>, System.Collections.Generic.IEnumerable<T>, DataStructure.ICountable, DataStructure.IClearable, ICloneable<QueueArray<T>>
Type Parameters
Name Description
T

The generic type within the structure.

Constructors

| Improve this Doc View Source

QueueArray()

Constructs a new queue.

Declaration
public QueueArray()
| Improve this Doc View Source

QueueArray(Int32)

Constructs a new queue.

Declaration
public QueueArray(int minimumCapacity)
Parameters
Type Name Description
System.Int32 minimumCapacity

The initial and smallest array size allowed by this list.

Properties

| Improve this Doc View Source

Count

Gets the current count of the data structure.

Declaration
public int Count { get; }
Property Value
Type Description
System.Int32
| Improve this Doc View Source

CurrentCapacity

Gets the current capacity of the list.

Declaration
public int CurrentCapacity { get; }
Property Value
Type Description
System.Int32
| Improve this Doc View Source

Item[Int32]

Gets or sets the T at an index in the queue.
Runtime: O(1)

Declaration
public T this[int index] { get; set; }
Parameters
Type Name Description
System.Int32 index

The index of the T to get or set.

Property Value
Type Description
T

The element at the provided index.

| Improve this Doc View Source

MinimumCapacity

Allows you to adjust the minimum capacity of this list.
Runtime (Get): O(1)
Runtime (Set): O(n), Ω(1)

Declaration
public int? MinimumCapacity { get; set; }
Property Value
Type Description
System.Nullable<System.Int32>
| Improve this Doc View Source

Newest

The current newest element in the queue.

Declaration
public T Newest { get; }
Property Value
Type Description
T
| Improve this Doc View Source

Oldest

The current oldest element in the queue.

Declaration
public T Oldest { get; }
Property Value
Type Description
T

Methods

| Improve this Doc View Source

Clear()

Returns the data structure to an empty state.

Declaration
public void Clear()
| Improve this Doc View Source

Clone()

Clones a T.

Declaration
public QueueArray<T> Clone()
Returns
Type Description
QueueArray<T>

A clone of the T.

| Improve this Doc View Source

Dequeue()

Removes the oldest item in the queue.

Declaration
public T Dequeue()
Returns
Type Description
T

The next item in the queue.

| Improve this Doc View Source

Enqueue(T)

Adds an item to the back of the queue.

Declaration
public void Enqueue(T addition)
Parameters
Type Name Description
T addition
| Improve this Doc View Source

GetEnumerator()

Declaration
public System.Collections.Generic.IEnumerator<T> GetEnumerator()
Returns
Type Description
System.Collections.Generic.IEnumerator<T>
| Improve this Doc View Source

Peek()

Gets the next item in the queue without removing it.

Declaration
public T Peek()
Returns
Type Description
T

The next item in the queue.

| Improve this Doc View Source

StepperBreak<TStep>(TStep)

Traverses values and invokes a function on every T value.

Declaration
public StepStatus StepperBreak<TStep>(TStep step = default(TStep))
    where TStep : struct, IFunc<T, StepStatus>
Parameters
Type Name Description
TStep step

The function to invoke on every T value.

Returns
Type Description
StepStatus

The status of the traversal.

Type Parameters
Name Description
TStep

The type of function to invoke on every T value.

| Improve this Doc View Source

ToArray()

Constructs an array with the values of this data structure.

Declaration
public T[] ToArray()
Returns
Type Description
T[]

An array with the values of this data structure.

Implements

IQueue<T>
IDataStructure<T>
ISteppable<T>
System.Collections.Generic.IEnumerable<>
DataStructure.ICountable
DataStructure.IClearable
ICloneable<T>
  • Improve this Doc
  • View Source
In This Article
Back to top Generated by DocFX