Summary
A simple stack of objects. Internally it is implemented as an array,
so Push can be O(n). Pop is O(1).
- Namespace
- Avalonia
.Collections .Pooled - Interfaces
- Base Types
-
- object
graph BT
Type-->Base0["object"]
Type-.->Interface0["ICollection"]
Type-.->Interface1["IReadOnlyCollection<T>"]
Type-.->Interface2["IEnumerable<T>"]
Type-.->Interface3["IEnumerable"]
Type-.->Interface4["IDisposable"]
Type-.->Interface5["IDeserializationCallback"]
Type["PooledStack<T>"]
class Type type-node
Syntax
[DebuggerTypeProxy(typeof(StackDebugView<>))]
[DebuggerDisplay("Count = {Count}")]
[Serializable]
public class PooledStack<T> : ICollection, IReadOnlyCollection<T>, IEnumerable<T>, IEnumerable,
IDisposable, IDeserializationCallback
Attributes
Type | Description |
---|---|
Debugger |
|
Debugger |
|
Serializable |
Type Parameters
Name | Description |
---|---|
T |
Constructors
Name | Summary |
---|---|
PooledStack |
Create a stack with the default initial capacity. |
PooledStack |
Create a stack with the default initial capacity. |
PooledStack |
Create a stack with the default initial capacity. |
PooledStack |
Create a stack with the default initial capacity and a custom ArrayPool. |
PooledStack |
Fills a Stack with the contents of a particular collection. The items are pushed onto the stack in the same order they are read by the enumerator. |
PooledStack |
Fills a Stack with the contents of a particular collection. The items are pushed onto the stack in the same order they are read by the enumerator. |
PooledStack |
Fills a Stack with the contents of a particular collection. The items are pushed onto the stack in the same order they are read by the enumerator. |
PooledStack |
Fills a Stack with the contents of a particular collection. The items are pushed onto the stack in the same order they are read by the enumerator. |
PooledStack |
Create a stack with a specific initial capacity. The initial capacity must be a non-negative number. |
PooledStack |
Create a stack with a specific initial capacity. The initial capacity must be a non-negative number. |
PooledStack |
Create a stack with a specific initial capacity. The initial capacity must be a non-negative number. |
PooledStack |
Create a stack with a specific initial capacity. The initial capacity must be a non-negative number. |
PooledStack |
Fills a Stack with the contents of a particular collection. The items are pushed onto the stack in the same order they are read by the enumerator. |
PooledStack |
Fills a Stack with the contents of a particular collection. The items are pushed onto the stack in the same order they are read by the enumerator. |
PooledStack |
Fills a Stack with the contents of a particular collection. The items are pushed onto the stack in the same order they are read by the enumerator. |
PooledStack |
Fills a Stack with the contents of a particular collection. The items are pushed onto the stack in the same order they are read by the enumerator. |
PooledStack |
Fills a Stack with the contents of a particular collection. The items are pushed onto the stack in the same order they are read by the enumerator. |
PooledStack |
Fills a Stack with the contents of a particular collection. The items are pushed onto the stack in the same order they are read by the enumerator. |
PooledStack |
Fills a Stack with the contents of a particular collection. The items are pushed onto the stack in the same order they are read by the enumerator. |
PooledStack |
Fills a Stack with the contents of a particular collection. The items are pushed onto the stack in the same order they are read by the enumerator. |
Properties
Methods
Name | Value | Summary |
---|---|---|
Clear |
void |
Removes all Objects from the Stack.
|
Contains |
bool |
Compares items using the default equality comparer
|
CopyTo |
void | |
CopyTo |
void | |
Dispose |
void | |
GetEnumerator |
PooledStack |
Returns an IEnumerator for this PooledStack.
|
Peek |
T |
Returns the top object on the stack without removing it. If the stack
is empty, Peek throws an InvalidOperationException.
|
Pop |
T |
Pops an item from the top of the stack. If the stack is empty, Pop
throws an InvalidOperationException.
|
Push |
void |
Pushes an item to the top of the stack.
|
RemoveWhere |
int |
This method removes all items which match the predicate.
The complexity is O(n).
|
ToArray |
T[] |
Copies the Stack to an array, in the same order Pop would return the items.
|
TrimExcess |
void | |
TryPeek |
bool | |
TryPop |
bool |