ds.GenericStack

GenericStack<T>

package haxe-ds

Available on all platforms

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:

Constructor

new ()

Creates a new empty GenericStack.

Variables

Methods

inline add (item:T ):Void

Pushes element item onto the stack.

inline first ():Null<T>

Returns the topmost stack element without removing it.

If the stack is empty, null is returned.

inline isEmpty ():Bool

Tells if the stack is empty.

iterator ():Iterator<T>

Returns an iterator over the elements of this GenericStack.

inline pop ():Null<T>

Returns the topmost stack element and removes it.

If the stack is empty, null is returned.

remove (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.

toString ():String

Returns a String representation of this GenericStack.

© 2005–2016 Haxe Foundation
Licensed under a MIT license.
http://api.haxe.org/haxe/ds/GenericStack.html

在线笔记
App下载
App下载

扫描二维码

下载编程狮App

公众号
微信公众号

编程狮公众号

意见反馈
返回顶部