Class StackQueue<T>
Collection that can be both a queue and a stack.
Inheritance
Namespace: Umbraco.Cms.Core.Collections
Assembly: Umbraco.Core.dll
Syntax
public class StackQueue<T>
Type Parameters
| Name | Description |
|---|---|
| T |
Constructors
View SourceStackQueue()
Declaration
public StackQueue()
Properties
View SourceCount
Gets the number of elements contained in the collection.
Declaration
public int Count { get; }
Property Value
| Type | Description |
|---|---|
| int |
Methods
View SourceClear()
Removes all elements from the collection.
Declaration
public void Clear()
Dequeue()
Removes and returns the object at the beginning of the queue (from the back).
Declaration
public T Dequeue()
Returns
| Type | Description |
|---|---|
| T | The object removed from the beginning of the queue. |
Enqueue(T?)
Adds an object to the queue (adds to the front).
Declaration
public void Enqueue(T? obj)
Parameters
| Type | Name | Description |
|---|---|---|
| T | obj | The object to add to the queue. |
PeekQueue()
Returns the object at the beginning of the queue without removing it.
Declaration
public T? PeekQueue()
Returns
| Type | Description |
|---|---|
| T | The object at the beginning of the queue, or the default value if the collection is empty. |
PeekStack()
Returns the object at the top of the stack without removing it.
Declaration
public T? PeekStack()
Returns
| Type | Description |
|---|---|
| T | The object at the top of the stack, or the default value if the collection is empty. |
Pop()
Removes and returns the object at the top of the stack (from the front).
Declaration
public T Pop()
Returns
| Type | Description |
|---|---|
| T | The object removed from the top of the stack. |
Push(T?)
Pushes an object onto the stack (adds to the front).
Declaration
public void Push(T? obj)
Parameters
| Type | Name | Description |
|---|---|---|
| T | obj | The object to push onto the stack. |