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

    Class KavenStack<T>

    Represents a variable size last-in-first-out (LIFO) collection of instances of the same specified type.

    1.1.19

    2021-12-14

    Type Parameters

    • T

    Implements

    Index

    Constructors

    Properties

    Accessors

    Methods

    Constructors

    • Type Parameters

      • T

      Returns KavenStack<T>

    • Type Parameters

      • T

      Parameters

      • maxSize: number

      Returns KavenStack<T>

    Properties

    array: T[]
    maxSize?: number

    Accessors

    • get Count(): number

      Gets the number of elements contained in the KavenStack.

      Returns number

      The number of elements contained in the KavenStack.

    • get MaxSize(): undefined | number

      Returns undefined | number

    Methods

    • Removes all objects from the KavenStack.

      Returns void

    • Determines whether an element is in the KavenStack.

      Parameters

      • item: T

        The object to locate in the KavenStack. The value can be undefined.

      Returns boolean

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

      Returns undefined | T

      The object at the top of the KavenStack.

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

      Returns undefined | T

      The object removed from the top of the KavenStack.

    • Inserts an object at the top of the KavenStack.

      Parameters

      • item: T

        The object to push onto the KavenStack. The value can be undefined.

      Returns void

    • Copies the KavenStack to a new array.

      Returns T[]

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