Class xbArray — implements cross browser Array
extends Class xbObject
class xbArray : xbObject { // constructor xbArray(); // methods void destroy(); Object item(Integer index); xbArray concat(xbArray xbarray); String join(String delimiter); Object pop(); Object push(Object obj); Object top(); xbArray reverse(); Object shift(); Integer unshift(Object obj); xbArray slice(Integer startIndex, Integer stopIndex); xbArray sort(Function cmp); Integer getLength(); // properties Array list; Integer length; }
xbArray is meant as a portable replacement for the built in Javascript Class Array since the implementations of Array still differ between IE and Mozilla.
readonly Array - Reference to the native Javascript Array used to implement the xbArray.
readonly Integer - Number of items currently in the xbArray.
Constructs an instance of the xbArray class
Returns. Nothing
Exceptions
None
Overrides xbObject.destroy. Destroys this instance of xbArray. If the objects contained in the xbArray have destroy methods defined, they will be called before the xbArray is destroyed.
Returns. Nothing
Exceptions
None
Return a reference to the index-th object contained in the xbArray. Returns null if index is not a valid position in the xbArray. index ranges from 0 to length - 1.
Returns. Object at offset index or null if index is not a valid offset.
Exceptions
None
Create and return a new xbArray with the xbArray array concatenated to the end. This does not change the original xbArray.
Returns. xbArray
Exceptions
None
Return a string constructed by joining the elements of the xbArray together with the String delimiter as delimiter.
Returns. String
Exceptions
None
Remove and return the last element of the xbArray of null if the xbArray is empty.
Returns. Object
Exceptions
None
places the object obj at the end of the xbArray and returns a reference to it.
Returns. Object Reference to object pushed onto the xbArray
Exceptions
None
Returns a reference to the element at the end of the xbArray without removing it from the xbArray. If the xbArray is empty, top() returns null.
Returns. Object
Exceptions
None
reverses the xbArray's elements and returns a reference to itself.
Returns. xbArray
Exceptions
None
Removes the first element from the xbArray and returns a reference to it or null if there is no element.
Returns. Object
Exceptions
None
inserts object obj in the front of the array and returns the new length of the xbArray.
Returns. Integer new length of xbArray
Exceptions
None
returns a xbArray consisting of the elements from startIndex to stopIndex.
Returns. xbArray
Exceptions
None
returns a sorted copy of the xbArray using the comparison function cmp(left, right) function.
cmp(left, right) compares left to the right and returns -1 if left is less than right; 0 if left is equal to right; and +1 if left is greater than right.
Returns. xbArray
Exceptions
None
Return the length of the xbArray (same as length).
Returns. Integer
Exceptions
None