Package | com.cyntaxic.cyntils |
Class | public class CynArray |
Inheritance | CynArray Object |
CynArray
class contains static functions for
manipulating arrays.
Method | Defined By | ||
---|---|---|---|
clone(array:Array):Array [static]
Clones an array. | CynArray | ||
copyShuffle(array:Array):Array [static]
Shuffles an array without shuffling the original. | CynArray | ||
getItemsByType(items:Array, type:Class):Array [static]
Returns all items of the given array that of the given type. | CynArray | ||
isSame(array1:Array, array2:Array):Boolean [static]
Compares the two arrays, whether they contain the same values at the same positions. | CynArray | ||
removeFirstOccurance(array:Array, item:*):Number [static]
Removes the first occurance of the given item out of the array. | CynArray | ||
removeItem(array:Array, item:*):Array [static]
Removes all occurances of a the given item out of the array. | CynArray | ||
removeLastOccurance(array:Array, item:*):Number [static]
Removes the last occurance of the given item out of the array. | CynArray | ||
shuffle(array:Array):Array [static]
Shuffles the items of the given array. | CynArray | ||
toString(array:Array, separator:String = , ):String [static]
Returns a string from the given array, using the specified separator. | CynArray |
clone | () | method |
public static function clone(array:Array):Array
Clones an array.
Parameters
array:Array — The array to clone.
|
Array — A clone of the array.
|
copyShuffle | () | method |
public static function copyShuffle(array:Array):Array
Shuffles an array without shuffling the original.
Parameters
array:Array — The array to shuffle.
|
Array — The shuffled array.
|
getItemsByType | () | method |
public static function getItemsByType(items:Array, type:Class):Array
Returns all items of the given array that of the given type.
Parameters
items:Array — The array that contains the items to look in.
| |
type:Class — The class that the items should match.
|
Array — A new array with all items that match the given class.
|
isSame | () | method |
public static function isSame(array1:Array, array2:Array):Boolean
Compares the two arrays, whether they contain the same values at the same positions.
Parameters
array1:Array — The first array for the comparison.
| |
array2:Array — The second array for the comparison.
|
Boolean — True if the two arrays contain the same values at the same
positions else false.
|
removeFirstOccurance | () | method |
public static function removeFirstOccurance(array:Array, item:*):Number
Removes the first occurance of the given item out of the array.
Parameters
array:Array — The array to remove the item out of.
| |
item:* — The item to remove.
|
Number — -1 if it could not be found, else the position where it has been deleted.
|
removeItem | () | method |
public static function removeItem(array:Array, item:*):Array
Removes all occurances of a the given item out of the array.
Parameters
array:Array — The array to remove the item out of.
| |
item:* — The item to remove.
|
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 item out of the array.
Parameters
array:Array — The array to remove the item out of.
| |
item:* — The item to remove.
|
Number — -1 if it could not be found, else the position where it has been deleted.
|
shuffle | () | method |
public static function shuffle(array:Array):Array
Shuffles the items of the given array.
Parameters
array:Array — The array to shuffle.
|
Array — The shuffled array.
|
toString | () | method |
public static function toString(array:Array, separator:String = , ):String
Returns a string from the given array, using the specified separator.
Parameters
array:Array — The array from which to return a string.
| |
separator:String (default = , ) — The array element separator.
|
String — A string representation of the given array.
|