Prev | Current Page 106 | Next

L. McColl-Sylvester and F. Ponticelli

"Professional haXe and Neko"


Once you have your instantiated Array object, you can start filling it with data and using it. Table 3 - 3
details the available methods used to manipulate Arrays.
Table 3 - 3
Array Field Description
length : Int Returns the current number of items stored in the
Array; length is a read - only property of the Array
object.
concat( a : Array < T > ) : Array < T > Joins an Array to the end of the current Array object.
copy() : Array < T > Returns a new Array structure containing the same
layout and data.
Table continued on following page
Part I: The Core Language
42
Array Field Description
insert( pos : Int, x : T ) : Void Provides a means to insert data into any location of
the Array.
iterator() : Iterator < Null < T > > Returns an iterator of Array values.
join( sep : String ) : String Returns a string value containing a string
representation of each of the Array items joined by a
given delimiter.
pop() : Null < T > Removes the last element of the Array and returns it.
push( x : T ) : Int Adds a given item to the end of the Array and returns
its location.


Pages:
94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118