<PackageReference Include="System.Collections.NonGeneric" Version="4.0.1-beta-23409" />

Queue

public class Queue : ICollection, IEnumerable
Represents a first-in, first-out collection of objects.
public virtual int Count { get; }

Gets the number of elements contained in the Queue.

public virtual bool IsSynchronized { get; }

Gets a value indicating whether access to the Queue is synchronized (thread safe).

public virtual object SyncRoot { get; }

Gets an object that can be used to synchronize access to the Queue.

public Queue()

Initializes a new instance of the Queue class that is empty, has the default initial capacity, and uses the default growth factor.

public Queue(int capacity)

Initializes a new instance of the Queue class that is empty, has the specified initial capacity, and uses the default growth factor.

public Queue(int capacity, float growFactor)

Initializes a new instance of the Queue class that is empty, has the specified initial capacity, and uses the specified growth factor.

public Queue(ICollection col)

Initializes a new instance of the Queue class that contains elements copied from the specified collection, has the same initial capacity as the number of elements copied, and uses the default growth factor.

public static Queue Synchronized(Queue queue)

Returns a new Queue that wraps the original queue, and is thread safe.

public virtual void Clear()

Removes all objects from the Queue.

public virtual object Clone()

Creates a shallow copy of the Queue.

public virtual bool Contains(object obj)

Determines whether an element is in the Queue.

public virtual void CopyTo(Array array, int index)

Copies the Queue elements to an existing one-dimensional Array, starting at the specified array index.

public virtual object Dequeue()

Removes and returns the object at the beginning of the Queue.

public virtual void Enqueue(object obj)

Adds an object to the end of the Queue.

public virtual IEnumerator GetEnumerator()

Returns an enumerator that iterates through the Queue.

public virtual object Peek()

Returns the object at the beginning of the Queue without removing it.

public virtual object[] ToArray()

Copies the Queue elements to a new array.

public virtual void TrimToSize()

Sets the capacity to the actual number of elements in the Queue.