System.Collections.Generic.Queue
Represents a generic queue of objects
A queue represents a first-in, first out collection (FIFO)
items are added with "Enqueue" and removed with "Dequeue"
The "Peek" method retrieves the oldest object but does not remove it.
For example you might want to send messages to a resource that can only handle one message at a time.
The queue class is a good collection to use when you are managing a limited resource
System.Collections.Generic.Queue
Methods
Count | The number of elements in the queue |
Clear | Removes all the objects |
Contains | Does an element exist |
CopyTo | Copies the elements to an existing one-dimensional array |
Dequeue | Removes and returns the object at the beginning of the queue |
Enqueue | Adds an object to the end of the queue |
GetEnumerator | Returns an enumerator for the queue |
Peek | Returns the object at the beginning of the queue without removing it |
ToArray |
System.Collections.Queue
This is not to be confused with the Non Generic SortedList Class introduced in .NET 1.1
System.Collections.Queue
© 2022 Better Solutions Limited. All Rights Reserved. © 2022 Better Solutions Limited TopPrevNext