Packageorg.pranaframework.utils
Classpublic class ArrayUtils

Contains utility methods for working with Array objects.



Public Methods
 MethodDefined by
  
clone(array:Array):Array
[static] Clones an array.
ArrayUtils
  
isSame(array1:Array, array2:Array):Boolean
[static] Compares the two arrays {
ArrayUtils
  
removeFirstOccurance(array:Array, item:*):Number
[static] Removes the first occurance of the given {
ArrayUtils
  
removeItem(array:Array, item:*):Array
[static] Removes all occurances of a the given {
ArrayUtils
  
removeLastOccurance(array:Array, item:*):Number
[static] Removes the last occurance of the given {
ArrayUtils
  
shuffle(array:Array):void
[static] Shuffles the items of the given {
ArrayUtils
Method detail
clone()method
public static function clone(array:Array):Array

Clones an array.

Parameters
array:Array — the array to clone

Returns
Array — a clone of the passed-in {
isSame()method 
public static function isSame(array1:Array, array2:Array):Boolean

Compares the two arrays {

Parameters
array1:Array — the first array for the comparison
 
array2:Array — the second array for the comparison

Returns
Boolean — {
removeFirstOccurance()method 
public static function removeFirstOccurance(array:Array, item:*):Number

Removes the first occurance of the given {

Parameters
array:Array — the array to remove the item out of
 
item:* — the item to remove

Returns
Number — {
removeItem()method 
public static function removeItem(array:Array, item:*):Array

Removes all occurances of a the given {

Parameters
array:Array — the array to remove the item out of
 
item:* — the item to remove

Returns
Array — List that contains the index of all removed occurances
removeLastOccurance()method 
public static function removeLastOccurance(array:Array, item:*):Number

Removes the last occurance of the given {

Parameters
array:Array — the array to remove the item out of
 
item:* — the item to remove

Returns
Number — {
shuffle()method 
public static function shuffle(array:Array):void

Shuffles the items of the given {

Parameters
array:Array — the array to shuffle