kaven-basic - v4.5.0
    Preparing search index...

    Interface IKavenStack<T>

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

    Type Parameters

    • T

    Implemented by

    Index

    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.