myIntArray INT[][] = [ [ 1,2], [3,4,5], [6,7,8,9] ] ;
// remove element [3][2] (with the value 7) myIntArray[3].removeElement(2); // remove element [2] (entire row with the value [3,4,5]) myIntArray.removeElement(2);
In the following sections, substitute the name of your array for arrayName.
arrayName.appendAll(appendArray Array in)
The elements of appendArray must be the same type as the elements of arrayName.
arrayName.appendElement(content ArrayElement in)
This function places an element at the end of the specified array and increments the size of the array by one. The content you append can be any expression with a compatible type.
The rules for assigning a literal are specified in "Assignments."
arrayName.getMaxSize ( ) returns (INT)
This function returns an integer that indicates the current maximum number of elements allowed in the array, as set by the maxSize property or by calling setMaxSize(). For multidimensional arrays, this value applies to the first dimension only.
arrayName.getSize ( ) returns (INT)
This function returns an integer that indicates the number of elements currently in the array. For multidimensional arrays, this value applies to the first dimension only. It is recommend that you use this function instead of sysLib.size() when you work with dynamic arrays.
arrayName.insertElement (content ArrayElement in, index INT in)
content is the new content (of the appropriate type for the array), and index indicates the location of the new element.
If index is one greater than the number of elements in the array, the function creates a new element at the end of the array and increments the array size by one, which is the equivalent of calling the appendElement() function. If index is less than 1 or greater than the array size + 1, EGL throws an IndexOutOfBoundsException.
arrayName.removeAll( )
This function removes the elements of the array from memory. The array can be used, but its size is zero.
arrayName.removeElement(index INT in)
This function removes the element at the specified location, decrements the array size by one, and decrements the index of each element that resides after the removed element.
index indicates the location of the element to be removed. If index is less than 1 or greater than the size of the array, EGL throws an IndexOutOfBoundsException.
arrayName.resize(size INT in)
This function adds or shrinks the current size of the array to the size specified in size. If the value of size is greater than the maximum size allowed for the array, EGL throws a RuntimeException.
arrayName.reSizeAll(sizes INT[] in)
This function expands or shrinks every dimension of a multidimensional array. The parameter sizes is an array of integers, with each successive element specifying the size of a successive dimension. If the number of dimensions resized is greater than the number of dimensions in arrayName, or if the value of an element in sizes is greater than the maximum size allowed in the equivalent dimension of arrayName, EGL throws a RuntimeException.
If you shrink the size of the array, higher numbered elements are removed and their values lost.
arrayName.setElementsEmpty ()
The function moves through the array, changing each element in the array to its initial state. For more information on initial values, see Data initialization.
arrayName.setMaxSize (size INT in)
The function sets the maximum number of elements allowed in the array. If you set the maximum size to a value less than the current size of the array, EGL throws a RuntimeException.
arrayName.setMaxSizes(sizes INT[] in)
This function sets every dimension of a multidimensional array. The parameter sizes is an array of integers, with each successive element specifying the maximum size of a successive dimension. If the number of dimensions specified is greater than the number of dimensions in arrayName, or if a value of an element in sizes is less than the current number of elements in the equivalent dimension of arrayName, EGL throws a RuntimeException.