haXe

List

class List<T>Available in flash, flash9, neko, js, phpA linked-list of elements. The list is composed of two-elements arrays that are chained together. It's optimized so that adding or removing an element doesn't imply to copy the whole array content everytime. var length(default,null) : IntThe number of elements in this list. function new() : VoidCreates a new empty list. function add( item : T ) : VoidAdd an element at the end of the list. function clear() : VoidMakes the list empty. function filter( f : T -> Bool ) : List<T>Returns a list filtered with f. The returned list will contain all elements x for which f(x) = true. function first() : TReturns the first element of the list, or null if the list is empty. function isEmpty() : BoolTells if a list is empty. function iterator() : Iterator<T>Returns an iterator on the elements of the list. function join( sep : String ) : StringJoin the element of the list by using the separator sep. function last() : TReturns the last element of the list, or null if the list is empty. function map<X>( f : T -> X ) : List<X>Returns a new list where all elements have been converted by the function f. function pop() : TRemoves the first element of the list and returns it or simply returns null if the list is empty. function push( item : T ) : VoidPush an element at the beginning of the list. function remove( v : T ) : BoolRemove the first element that is == v from the list. Returns true if an element was removed, false otherwise. function toString() : StringReturns a displayable representation of the String.
version #2477, modified 2008-07-28 10:02:46 by api