Table of Contents

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

T

The type of elements in the stack.

Inheritance
IndexableStack<T>
Implements
Inherited Members

Properties

Count

public int Count { get; }

Property Value

int

this[int]

public T this[int index] { get; }

Parameters

index int

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

index int

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

value T