Packagestarling.utils
Classpublic class ArrayUtil
InheritanceArrayUtil Inheritance Object

A utility class containing methods related to the Array class.

Many methods of the Array class cause the creation of temporary objects, which is problematic for any code that repeats very often. The utility methods in this class can be used to avoid that.



Public Methods
 MethodDefined By
  
insertAt(array:Array, index:int, object:Object):void
[static] Inserts an element into the array at the specified index.
ArrayUtil
  
removeAt(array:Array, index:int):Object
[static] Removes the element at the specified index from the array.
ArrayUtil
Method Detail
insertAt()method
public static function insertAt(array:Array, index:int, object:Object):void

Inserts an element into the array at the specified index. You can use a negative integer to specify a position relative to the end of the array (for example, -1 will insert at the very end). If index is higher than the array length, gaps are filled up with null values.

Parameters

array:Array
 
index:int
 
object:Object

removeAt()method 
public static function removeAt(array:Array, index:int):Object

Removes the element at the specified index from the array. You can use a negative integer to specify a position relative to the end of the array (for example, -1 will remove the last element).

Parameters

array:Array
 
index:int

Returns
Object