Class IndexableStack<T>
- Namespace
- Echo
- Assembly
- Echo.dll
Provides an implementation of a stack of which the elements can be accessed by index.
public class IndexableStack<T> : IReadOnlyList<T>, IReadOnlyCollection<T>, IEnumerable<T>, IEnumerable
Type Parameters
TThe type of elements in the stack.
- Inheritance
-
IndexableStack<T>
- Implements
-
IEnumerable<T>
- Inherited Members
Properties
Count
public int Count { get; }
Property Value
this[int]
public T this[int index] { get; }
Parameters
indexint
Property Value
- T
Methods
Clear()
Removes all elements from the stack.
public virtual void Clear()
GetEnumerator()
public IEnumerator<T> GetEnumerator()
Returns
- IEnumerator<T>
Peek()
Returns the top element of the stack.
public T Peek()
Returns
- T
The top element.
Peek(int)
Returns the n-th top-most element of the stack.
public T Peek(int index)
Parameters
indexint
Returns
- T
The element.
Pop()
Pops a single element from the stack.
public virtual T Pop()
Returns
- T
The popped element.
Push(T)
Pushes a single element onto the stack.
public virtual void Push(T value)
Parameters
valueT