class List<T>Available in flash8, flash, neko, js, php, cpp, cs, javaA 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 incur copying costs 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() : Null<T>Returns 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() : Null<T>Returns 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() : Null<T>Removes 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 List.
version #15025, modified 2012-07-16 12:30:01 by api
0 comment