Class: Stack

rune.util.Stack()

The Stack class represents a list of executable objects.

Constructor

new Stack()

Creates a new instance of the Stack class.
Source:

Members

(readonly) duration :number

The time (specified in milliseconds) it took to execute the contents of the entire list during the previous execution.
Type:
  • number
Source:

(readonly) length :number

The length of the stack, ie how many function calls are queued in the stack.
Type:
  • number
Source:

Methods

add(fn, scopeopt, argsopt) → {undefined}

Adds a function to the stack.
Parameters:
Name Type Attributes Default Description
fn function Function to add.
scope Object <optional>
null The scope of the function call.
args Array <optional>
null Function argument.
Source:
Throws:
Argument must be of valid function type.
Type
TypeError
Returns:
Type
undefined

clear(disposeopt) → {undefined}

Empty the entire stack.
Parameters:
Name Type Attributes Description
dispose boolean <optional>
Whether or not the stack should empty allocated memory. Note that this process renders the object unusable.
Source:
Returns:
Type
undefined

dispose() → {undefined}

Process that frees the memory allocated by the current stack. Note that this process renders the object unusable.
Source:
Returns:
Type
undefined

execute(…args) → {undefined}

Executes all objects in the current stack.
Parameters:
Name Type Attributes Description
args Object <repeatable>
Functional arguments.
Source:
Returns:
Type
undefined

remove(fn, scopeopt) → {undefined}

Removes a function from the stack.
Parameters:
Name Type Attributes Default Description
fn function Function to remove.
scope Object <optional>
null The scope in which the function will be executed.
Source:
Returns:
Type
undefined