| Method | Defined by | ||
|---|---|---|---|
|
createProgressiveArray(n:Number, s:Number, e:Number):Array
[static]
| ArrayUtil | ||
|
createRepeatingArray(n:Number, v:Number):Array
[static]
| ArrayUtil | ||
|
getItemIndex(src:Array, item:*):Number
[static]
Returns the index number of an item in the array if that
item exists.
| ArrayUtil | ||
|
insertArrayAtEnd(sourceArray:Array, arrayToInsert:Array):Array
[static]
Inserts all the elements of the arrayToInsert Array into the sourceArray.
| ArrayUtil | ||
|
insertArrayAtIndex(sourceArray:Array, arrayToInsert:Array, idx:int):Array
[static]
| ArrayUtil | ||
|
insertAt(src:Array, idx:Number, data:*):void
[static]
Inserts the data at the specified index of the array.
| ArrayUtil | ||
|
remove(src:Array, item:*):void
[static]
Removes the FIRST instance of the item passed in as a parameter
| ArrayUtil | ||
|
removeDuplicates(arr:Array):Array
[static]
| ArrayUtil | ||
|
removeItemAt(src:Array, idx:uint):void
[static]
| ArrayUtil | ||
|
swapByIndex(src:Array, idx1:Number, idx2:Number):void
[static]
| ArrayUtil | ||
|
swapByValue(src:Array, item1:*, item2:*):void
[static]
Swaps the positions of two items if they are found in the
source array.
| ArrayUtil | ||
| createProgressiveArray | () | method |
public static function createProgressiveArray(n:Number, s:Number, e:Number):ArrayParameters
n:Number |
|
s:Number |
|
e:Number |
Array |
| createRepeatingArray | () | method |
public static function createRepeatingArray(n:Number, v:Number):ArrayParameters
n:Number |
|
v:Number |
Array |
| getItemIndex | () | method |
public static function getItemIndex(src:Array, item:*):NumberReturns the index number of an item in the array if that item exists. Else NaN is returned
Parameterssrc:Array |
|
item:* |
Number |
| insertArrayAtEnd | () | method |
public static function insertArrayAtEnd(sourceArray:Array, arrayToInsert:Array):ArrayInserts all the elements of the arrayToInsert Array into the sourceArray. The elements are inserted at the end of the sourceArray. TODO: This isnt the most efficient way to do it. There is a way using splice or something.
ParameterssourceArray:Array |
|
arrayToInsert:Array |
Array |
| insertArrayAtIndex | () | method |
public static function insertArrayAtIndex(sourceArray:Array, arrayToInsert:Array, idx:int):ArrayParameters
sourceArray:Array |
|
arrayToInsert:Array |
|
idx:int |
Array |
| insertAt | () | method |
public static function insertAt(src:Array, idx:Number, data:*):voidInserts the data at the specified index of the array. The operation is carried out on the source array and not on a copy.
Parameterssrc:Array — The source Array
|
|
idx:Number — The index at which data needs to be inserted.
The index can be greater than the length of the
array, in which case, all intermediate values are
initialized to undefined.
|
|
data:* — The data to be inserted into the Array.
|
var a:Array = [0,1,2,3,4,5]
ArrayUtil.insertAt(a, 2, "inserted");
trace(a) //[0,1,inserted,2,3,4,5]
| remove | () | method |
public static function remove(src:Array, item:*):voidRemoves the FIRST instance of the item passed in as a parameter
Parameterssrc:Array |
|
item:* |
| removeDuplicates | () | method |
public static function removeDuplicates(arr:Array):ArrayParameters
arr:Array |
Array |
| removeItemAt | () | method |
public static function removeItemAt(src:Array, idx:uint):voidParameters
src:Array |
|
idx:uint |
| swapByIndex | () | method |
public static function swapByIndex(src:Array, idx1:Number, idx2:Number):voidParameters
src:Array |
|
idx1:Number |
|
idx2:Number |
| swapByValue | () | method |
public static function swapByValue(src:Array, item1:*, item2:*):voidSwaps the positions of two items if they are found in the source array.
Parameterssrc:Array |
|
item1:* |
|
item2:* |