DoubleEndedQueue<T> Class

Represents a growable double-ended queue.

public sealed class DoubleEndedQueue<T> : ICollection<T>, IEnumerable<T>, IReadOnlyCollection<T>, IReadOnlyList<T>, IEnumerable

Type parameters

T
Implements

Nested types

NameDescription
DoubleEndedQueue<T>.Enumerator

Constructors

NameDescription
DoubleEndedQueue(int)Initializes a new instance of DoubleEndedQueue<T> with the specified initial capacity.

DoubleEndedQueue(int)

DoubleEndedQueue.cs

Initializes a new instance of DoubleEndedQueue<T> with the specified initial capacity.

public DoubleEndedQueue(int capacity)

Parameters

capacity int

Properties

NameDescription
CountGets the number of elements contained in the collection.
System.Collections.Generic.ICollection<T>.IsReadOnly

Gets the number of elements contained in the collection.

public int Count { get; }

Property value

int

System.Collections.Generic.ICollection<T>.IsReadOnly

DoubleEndedQueue.cs
bool ICollection<T>.IsReadOnly { get; }

Property value

bool

No documentation is available.

Indexers

NameDescription
this[int]Gets the item at the specified index.

Gets the item at the specified index.

public T this[int index] { get; }

Parameters

index int

Property value

T

Methods

NameDescription
AddFirst(T)Adds an item at the beginning of the collection.
AddLast(T)Adds an item at the end of the collection.
Clear()
Contains(T)
CopyTo(T[], int)
GetEnumerator()
IndexOf(T)
RemoveFirst()Removes and returns the first item.
RemoveLast()Removes and returns the last item.
System.Collections.Generic.ICollection<T>.Add(T)
System.Collections.Generic.ICollection<T>.Remove(T)
System.Collections.Generic.IEnumerable<T>.GetEnumerator()
System.Collections.IEnumerable.GetEnumerator()

Adds an item at the beginning of the collection.

public void AddFirst(T value)

Parameters

value T

Adds an item at the end of the collection.

public void AddLast(T value)

Parameters

value T
public void Clear()

No documentation is available.

public bool Contains(T item)

Parameters

item T

Returns

bool

No documentation is available.

CopyTo(T[], int)

DoubleEndedQueue.cs
public void CopyTo(T[] array, int arrayIndex)

Parameters

array T[]
arrayIndex int

No documentation is available.

GetEnumerator()

DoubleEndedQueue.cs
public DoubleEndedQueue<T>.Enumerator GetEnumerator()

No documentation is available.

public int IndexOf(T item)

Parameters

item T

Returns

int

No documentation is available.

RemoveFirst()

DoubleEndedQueue.cs

Removes and returns the first item.

public T RemoveFirst()

Returns

T

Removes and returns the last item.

public T RemoveLast()

Returns

T

System.Collections.Generic.ICollection<T>.Add(T)

DoubleEndedQueue.cs
void ICollection<T>.Add(T item)

Parameters

item T

No documentation is available.

System.Collections.Generic.ICollection<T>.Remove(T)

DoubleEndedQueue.cs
bool ICollection<T>.Remove(T item)

Parameters

item T

Returns

bool

No documentation is available.

System.Collections.Generic.IEnumerable<T>.GetEnumerator()

DoubleEndedQueue.cs
IEnumerator<T> IEnumerable<T>.GetEnumerator()

No documentation is available.

System.Collections.IEnumerable.GetEnumerator()

DoubleEndedQueue.cs
IEnumerator IEnumerable.GetEnumerator()

No documentation is available.