Interface IKavenStack<T>

interface IKavenStack {
    Count: number;
    Clear(): void;
    Contains(item): boolean;
    Peek(): undefined | T;
    Pop(): undefined | T;
    Push(item): void;
    ToArray(): T[];
}

Type Parameters

  • T

Implemented by

Properties

Methods

Properties

Count: number

Gets the number of elements contained in the stack.

Methods

  • Removes all objects from the stack.

    Returns void

  • Determines whether an element is in the stack.

    Parameters

    • item: T

    Returns boolean

    true if item is found in the stack; otherwise, false.

  • Returns the object at the top of the stack without removing it.

    Returns undefined | T

    The object at the top of the stack.

  • Removes and returns the object at the top of the stack.

    Returns undefined | T

    The object removed from the top of the stack.

  • Inserts an object at the top of the stack.

    Parameters

    • item: T

    Returns void

  • Copies the stack to a new array.

    Returns T[]

    A new array containing copies of the elements of the stack.

Generated using TypeDoc