Options
All
  • Public
  • Public/Protected
  • All
Menu

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

since

1.1.19

version

2019-03-21

Type parameters

  • T

Hierarchy

  • KavenStack

Implements

Index

Constructors

Properties

Accessors

Methods

Constructors

constructor

  • Type parameters

    • T

    Returns KavenStack<T>

Properties

Optional MaxLength

MaxLength: number

Protected array

array: T[]

Accessors

Count

  • get Count(): number
  • Gets the number of elements contained in the KavenStack.

    Returns number

    The number of elements contained in the KavenStack.

Methods

Clear

  • Clear(): void
  • Removes all objects from the KavenStack.

    Returns void

Contains

  • Contains(item: T): boolean
  • 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

Peek

  • Peek(): undefined | T
  • Returns the object at the top of the KavenStack without removing it.

    Returns undefined | T

    The object at the top of the KavenStack.

Pop

  • Pop(): undefined | T
  • Removes and returns the object at the top of the KavenStack.

    Returns undefined | T

    The object removed from the top of the KavenStack.

Push

  • Push(item: T): void
  • 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

ToArray

  • ToArray(): T[]
  • Copies the KavenStack to a new array.

    Returns T[]

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

Legend

  • Variable
  • Function
  • Function with type parameter
  • Type alias
  • Type alias with type parameter
  • Class
  • Class with type parameter
  • Property
  • Method
  • Interface
  • Interface with type parameter
  • Enumeration
  • Protected property

Generated using TypeDoc