A stack of elements.

This class is generic, which means one type is generated for each type parameter T on static targets. For example:

The generated name is an implementation detail and should not be relied upon.

See also:

Constructor

@:keepnew()

Creates a new empty GenericStack.

Variables

@:keephead:GenericCell<T>

Methods

@:keepinlineadd(item:T):Void

Pushes element item onto the stack.

@:keepinlinefirst():Null<T>

Returns the topmost stack element without removing it.

If the stack is empty, null is returned.

@:keepinlineisEmpty():Bool

Tells if the stack is empty.

@:keepiterator():Iterator<T>

Returns an iterator over the elements of this GenericStack.

@:keepinlinepop():Null<T>

Returns the topmost stack element and removes it.

If the stack is empty, null is returned.

@:keepremove(v:T):Bool

Removes the first element which is equal to v according to the == operator.

This method traverses the stack until it finds a matching element and unlinks it, returning true.

If no matching element is found, false is returned.

@:keeptoString():String

Returns a String representation of this GenericStack.