Packagecom.yworks.bridge.util
Classpublic class Arrays
InheritanceArrays Inheritance YObject Inheritance Object

Arrays contains static methods which operate on arrays.



Public Methods
 MethodDefined By
  
Arrays(init:Boolean = true)
Arrays
  
asList(array:Vector.<Object>):List
[static] Answers a List on the objects in the specified array.
Arrays
  
binarySearch(array:Vector.<int>, value:int):int
[static] Performs a binary search for the specified element in the specified sorted array.
Arrays
  
binarySearchChar(array:Vector.<String>, value:String):int
[static] Performs a binary search for the specified element in the specified sorted array.
Arrays
  
binarySearchDouble(array:Vector.<Number>, value:Number):int
[static] Performs a binary search for the specified element in the specified sorted array.
Arrays
  
binarySearchFloat(array:Vector.<Number>, value:Number):int
[static] Performs a binary search for the specified element in the specified sorted array.
Arrays
  
binarySearchInt(array:Vector.<int>, value:int):int
[static] Performs a binary search for the specified element in the specified sorted array.
Arrays
  
binarySearchLong(array:Vector.<LongImpl>, value:LongImpl):int
[static] Performs a binary search for the specified element in the specified sorted array.
Arrays
  
binarySearchObject(array:Vector.<Object>, object:Object):int
[static] Performs a binary search for the specified element in the specified sorted array.
Arrays
  
binarySearchShort(array:Vector.<int>, value:int):int
[static] Performs a binary search for the specified element in the specified sorted array.
Arrays
  
binarySearchWithComparator(array:Vector.<Object>, object:Object, comparator:Comparator):int
[static] Performs a binary search for the specified element in the specified sorted array using the Comparator to compare elements.
Arrays
  
equals(a:Vector.<int>, b:Vector.<int>):Boolean
[static]
Arrays
  
equals2(array1:Vector.<Number>, array2:Vector.<Number>):Boolean
[static] Compares the two arrays.
Arrays
  
fill(array:Vector.<int>, value:int):void
[static] Fills the array with the given value.
Arrays
  
fill2(array:Vector.<Boolean>, value:Boolean):void
[static] Fills the array with the given value.
Arrays
  
fill3(array:Vector.<Object>, value:Object):void
[static] Fills the array with the given value.
Arrays
  
fillChar(array:Vector.<String>, value:String):void
[static] Fills the array with the given value.
Arrays
  
fillDouble(array:Vector.<Number>, value:Number):void
[static] Fills the array with the given value.
Arrays
  
fillFloat(array:Vector.<Number>, value:Number):void
[static] Fills the array with the given value.
Arrays
  
fillInt(array:Vector.<int>, value:int):void
[static] Fills the array with the given value.
Arrays
  
fillLong(array:Vector.<LongImpl>, value:LongImpl):void
[static] Fills the array with the given value.
Arrays
  
fillRangeBool(array:Vector.<Boolean>, start:int, end:int, value:Boolean):void
[static] Fills the section of the array between the given indices with the given value.
Arrays
  
fillRangeByte(array:Vector.<int>, start:int, end:int, value:int):void
[static] Fills the section of the array between the given indices with the given value.
Arrays
  
fillRangeChar(array:Vector.<String>, start:int, end:int, value:String):void
[static] Fills the section of the array between the given indices with the given value.
Arrays
  
fillRangeDouble(array:Vector.<Number>, start:int, end:int, value:Number):void
[static] Fills the section of the array between the given indices with the given value.
Arrays
  
fillRangeFloat(array:Vector.<Number>, start:int, end:int, value:Number):void
[static] Fills the section of the array between the given indices with the given value.
Arrays
  
fillRangeInt(array:Vector.<int>, start:int, end:int, value:int):void
[static] Fills the section of the array between the given indices with the given value.
Arrays
  
fillRangeLong(array:Vector.<LongImpl>, start:int, end:int, value:LongImpl):void
[static] Fills the section of the array between the given indices with the given value.
Arrays
  
fillRangeObj(array:Vector.<Object>, start:int, end:int, value:Object):void
[static] Fills the section of the array between the given indices with the given value.
Arrays
  
fillRangeShort(array:Vector.<int>, start:int, end:int, value:int):void
[static] Fills the section of the array between the given indices with the given value.
Arrays
  
fillShort(array:Vector.<int>, value:int):void
[static] Fills the array with the given value.
Arrays
  
getClass():Class
[override]
Arrays
 Inherited
hashCode():int
YObject
  
sort(array:Vector.<Object>, comparator:Comparator):void
[static] Performs a sort on the given array.
Arrays
  
sort2(array:Vector.<Object>):void
[static] Performs a sort on the given array.
Arrays
  
sort3(array:Vector.<Number>):void
[static] Performs a sort on the given array.
Arrays
  
sort4(array:Vector.<int>):void
[static] Performs a sort on the given array.
Arrays
  
sort5(array:Vector.<LongImpl>):void
[static] Performs a sort on given array.
Arrays
  
sort6(array:Vector.<String>):void
[static] Performs a sort on the given array.
Arrays
  
sort7(array:Vector.<int>):void
[static] Performs a sort on the given array.
Arrays
  
sort8(array:Vector.<Number>):void
[static] Performs a sort on the given array.
Arrays
  
sort9(array:Vector.<int>):void
[static] Performs a sort on the given array.
Arrays
  
sortBytesRange(array:Vector.<int>, start:int, end:int):void
[static] Performs a sort on the section of the array between the given indices.
Arrays
  
sortCharsRange(array:Vector.<String>, start:int, end:int):void
[static] Performs a sort on the section of the array between the given indices.
Arrays
  
sortDoublesRange(array:Vector.<Number>, start:int, end:int):void
[static] Performs a sort on the section of the array between the given indices.
Arrays
  
sortFloatsRange(array:Vector.<Number>, start:int, end:int):void
[static] Performs a sort on the section of the array between the given indices.
Arrays
  
sortIntsRange(array:Vector.<int>, start:int, end:int):void
[static] Performs a sort on the section of the array between the given indices.
Arrays
  
sortLongsRange(array:Vector.<LongImpl>, start:int, end:int):void
[static] Performs a sort on the section of the array between the given indices.
Arrays
  
sortObjectsRange(array:Vector.<Object>, start:int, end:int):void
[static] Performs a sort on the section of the array between the given indices.
Arrays
  
sortObjectsRangeWithComparator(array:Vector.<Object>, start:int, end:int, comparator:Comparator):void
[static] Performs a sort on the section of the array between the given indices.
Arrays
  
sortShortsRange(array:Vector.<int>, start:int, end:int):void
[static] Performs a sort on the given array.
Arrays
Constructor Detail
Arrays()Constructor
public function Arrays(init:Boolean = true)



Parameters
init:Boolean (default = true)
Method Detail
asList()method
public static function asList(array:Vector.<Object>):List

Answers a List on the objects in the specified array. The size of the List cannot be modified, i.e. adding and removing are unsupported, but the elements can be set. Setting an element modifies the underlying array.

Parameters

array:Vector.<Object> — the array

Returns
List — a List on the specified array
binarySearch()method 
public static function binarySearch(array:Vector.<int>, value:int):int

Performs a binary search for the specified element in the specified sorted array.

Parameters

array:Vector.<int> — the sorted byte array to search
 
value:int — the byte element to find

Returns
int — the non-negative index of the element, or a negative index which is the -index - 1 where the element would be inserted
binarySearchChar()method 
public static function binarySearchChar(array:Vector.<String>, value:String):int

Performs a binary search for the specified element in the specified sorted array.

Parameters

array:Vector.<String> — the sorted char array to search
 
value:String — the char element to find

Returns
int — the non-negative index of the element, or a negative index which is the -index - 1 where the element would be inserted
binarySearchDouble()method 
public static function binarySearchDouble(array:Vector.<Number>, value:Number):int

Performs a binary search for the specified element in the specified sorted array.

Parameters

array:Vector.<Number> — the sorted double array to search
 
value:Number — the double element to find

Returns
int — the non-negative index of the element, or a negative index which is the -index - 1 where the element would be inserted
binarySearchFloat()method 
public static function binarySearchFloat(array:Vector.<Number>, value:Number):int

Performs a binary search for the specified element in the specified sorted array.

Parameters

array:Vector.<Number> — the sorted float array to search
 
value:Number — the float element to find

Returns
int — the non-negative index of the element, or a negative index which is the -index - 1 where the element would be inserted
binarySearchInt()method 
public static function binarySearchInt(array:Vector.<int>, value:int):int

Performs a binary search for the specified element in the specified sorted array.

Parameters

array:Vector.<int> — the sorted int array to search
 
value:int — the int element to find

Returns
int — the non-negative index of the element, or a negative index which is the -index - 1 where the element would be inserted
binarySearchLong()method 
public static function binarySearchLong(array:Vector.<LongImpl>, value:LongImpl):int

Performs a binary search for the specified element in the specified sorted array.

Parameters

array:Vector.<LongImpl> — the sorted long array to search
 
value:LongImpl — the long element to find

Returns
int — the non-negative index of the element, or a negative index which is the -index - 1 where the element would be inserted
binarySearchObject()method 
public static function binarySearchObject(array:Vector.<Object>, object:Object):int

Performs a binary search for the specified element in the specified sorted array.

Parameters

array:Vector.<Object> — the sorted Object array to search
 
object:Object — the Object element to find

Returns
int — the non-negative index of the element, or a negative index which is the -index - 1 where the element would be inserted

Throws
TypeError — when an element in the array or the search element does not implement Comparable, or cannot be compared to each other
binarySearchShort()method 
public static function binarySearchShort(array:Vector.<int>, value:int):int

Performs a binary search for the specified element in the specified sorted array.

Parameters

array:Vector.<int> — the sorted short array to search
 
value:int — the short element to find

Returns
int — the non-negative index of the element, or a negative index which is the -index - 1 where the element would be inserted
binarySearchWithComparator()method 
public static function binarySearchWithComparator(array:Vector.<Object>, object:Object, comparator:Comparator):int

Performs a binary search for the specified element in the specified sorted array using the Comparator to compare elements.

Parameters

array:Vector.<Object> — the sorted char array to search
 
object:Object — the char element to find
 
comparator:Comparator — the Comparator

Returns
int — the non-negative index of the element, or a negative index which is the -index - 1 where the element would be inserted

Throws
TypeError — when an element in the array and the search element cannot be compared to each other using the Comparator
equals()method 
public static function equals(a:Vector.<int>, b:Vector.<int>):Boolean

Parameters

a:Vector.<int>
 
b:Vector.<int>

Returns
Boolean
equals2()method 
public static function equals2(array1:Vector.<Number>, array2:Vector.<Number>):Boolean

Compares the two arrays. The values are compared in the same manner as Double.equals().

Parameters

array1:Vector.<Number> — the first double array
 
array2:Vector.<Number> — the second double array

Returns
Boolean — true when the arrays have the same length and the elements at each index in the two arrays are equal, false otherwise

See also

fill()method 
public static function fill(array:Vector.<int>, value:int):void

Fills the array with the given value.

Parameters

array:Vector.<int> — the byte array to fill
 
value:int — the byte element

fill2()method 
public static function fill2(array:Vector.<Boolean>, value:Boolean):void

Fills the array with the given value.

Parameters

array:Vector.<Boolean> — the boolean array to fill
 
value:Boolean — the boolean element

fill3()method 
public static function fill3(array:Vector.<Object>, value:Object):void

Fills the array with the given value.

Parameters

array:Vector.<Object> — the Object array to fill
 
value:Object — the Object element

fillChar()method 
public static function fillChar(array:Vector.<String>, value:String):void

Fills the array with the given value.

Parameters

array:Vector.<String> — the char array to fill
 
value:String — the char element

fillDouble()method 
public static function fillDouble(array:Vector.<Number>, value:Number):void

Fills the array with the given value.

Parameters

array:Vector.<Number> — the float array to fill
 
value:Number — the float element

fillFloat()method 
public static function fillFloat(array:Vector.<Number>, value:Number):void

Fills the array with the given value.

Parameters

array:Vector.<Number> — the float array to fill
 
value:Number — the float element

fillInt()method 
public static function fillInt(array:Vector.<int>, value:int):void

Fills the array with the given value.

Parameters

array:Vector.<int> — the int array to fill
 
value:int — the int element

fillLong()method 
public static function fillLong(array:Vector.<LongImpl>, value:LongImpl):void

Fills the array with the given value.

Parameters

array:Vector.<LongImpl> — the long array to fill
 
value:LongImpl — the long element

fillRangeBool()method 
public static function fillRangeBool(array:Vector.<Boolean>, start:int, end:int, value:Boolean):void

Fills the section of the array between the given indices with the given value.

Parameters

array:Vector.<Boolean> — the boolean array to fill
 
start:int — the start index
 
end:int — the end index + 1
 
value:Boolean — the boolean element


Throws
IllegalArgumentException — when start > end
 
RangeError — when start < 0 or end > array.size()
fillRangeByte()method 
public static function fillRangeByte(array:Vector.<int>, start:int, end:int, value:int):void

Fills the section of the array between the given indices with the given value.

Parameters

array:Vector.<int> — the byte array to fill
 
start:int — the start index
 
end:int — the end index + 1
 
value:int — the byte element


Throws
IllegalArgumentException — when start > end
 
RangeError — when start < 0 or end > array.size()
fillRangeChar()method 
public static function fillRangeChar(array:Vector.<String>, start:int, end:int, value:String):void

Fills the section of the array between the given indices with the given value.

Parameters

array:Vector.<String> — the char array to fill
 
start:int — the start index
 
end:int — the end index + 1
 
value:String — the char element


Throws
IllegalArgumentException — when start > end
 
RangeError — when start < 0 or end > array.size()
fillRangeDouble()method 
public static function fillRangeDouble(array:Vector.<Number>, start:int, end:int, value:Number):void

Fills the section of the array between the given indices with the given value.

Parameters

array:Vector.<Number> — the double array to fill
 
start:int — the start index
 
end:int — the end index + 1
 
value:Number — the double element


Throws
IllegalArgumentException — when start > end
 
RangeError — when start < 0 or end > array.size()
fillRangeFloat()method 
public static function fillRangeFloat(array:Vector.<Number>, start:int, end:int, value:Number):void

Fills the section of the array between the given indices with the given value.

Parameters

array:Vector.<Number> — the float array to fill
 
start:int — the start index
 
end:int — the end index + 1
 
value:Number — the float element


Throws
IllegalArgumentException — when start > end
 
RangeError — when start < 0 or end > array.size()
fillRangeInt()method 
public static function fillRangeInt(array:Vector.<int>, start:int, end:int, value:int):void

Fills the section of the array between the given indices with the given value.

Parameters

array:Vector.<int> — the int array to fill
 
start:int — the start index
 
end:int — the end index + 1
 
value:int — the int element


Throws
IllegalArgumentException — when start > end
 
RangeError — when start < 0 or end > array.size()
fillRangeLong()method 
public static function fillRangeLong(array:Vector.<LongImpl>, start:int, end:int, value:LongImpl):void

Fills the section of the array between the given indices with the given value.

Parameters

array:Vector.<LongImpl> — the long array to fill
 
start:int — the start index
 
end:int — the end index + 1
 
value:LongImpl — the long element


Throws
IllegalArgumentException — when start > end
 
RangeError — when start < 0 or end > array.size()
fillRangeObj()method 
public static function fillRangeObj(array:Vector.<Object>, start:int, end:int, value:Object):void

Fills the section of the array between the given indices with the given value.

Parameters

array:Vector.<Object> — the Object array to fill
 
start:int — the start index
 
end:int — the end index + 1
 
value:Object — the Object element


Throws
IllegalArgumentException — when start > end
 
RangeError — when start < 0 or end > array.size()
fillRangeShort()method 
public static function fillRangeShort(array:Vector.<int>, start:int, end:int, value:int):void

Fills the section of the array between the given indices with the given value.

Parameters

array:Vector.<int> — the short array to fill
 
start:int — the start index
 
end:int — the end index + 1
 
value:int — the short element


Throws
IllegalArgumentException — when start > end
 
RangeError — when start < 0 or end > array.size()
fillShort()method 
public static function fillShort(array:Vector.<int>, value:int):void

Fills the array with the given value.

Parameters

array:Vector.<int> — the short array to fill
 
value:int — the short element

getClass()method 
override public function getClass():Class

Returns
Class
sort()method 
public static function sort(array:Vector.<Object>, comparator:Comparator):void

Performs a sort on the given array. Elements will be re-ordered into ascending order according to the given Comparator.

Parameters

array:Vector.<Object> — the Object array to sort
 
comparator:Comparator — the Comparator


Throws
TypeError — when elements in the array cannot be compared to each other using the Comparator
sort2()method 
public static function sort2(array:Vector.<Object>):void

Performs a sort on the given array. Elements will be re-ordered into ascending order.

Parameters

array:Vector.<Object> — the Object array to sort


Throws
TypeError — when an element in the array does not implement Comparable or elements cannot be compared to each other
sort3()method 
public static function sort3(array:Vector.<Number>):void

Performs a sort on the given array. Elements will be re-ordered into ascending order.

Parameters

array:Vector.<Number> — the double array to sort

See also

sort4()method 
public static function sort4(array:Vector.<int>):void

Performs a sort on the given array. Elements will be re-ordered into ascending order.

Parameters

array:Vector.<int> — the int array to sort

sort5()method 
public static function sort5(array:Vector.<LongImpl>):void

Performs a sort on given array. Elements will be re-ordered into ascending order.

Parameters

array:Vector.<LongImpl> — the long array to sort

sort6()method 
public static function sort6(array:Vector.<String>):void

Performs a sort on the given array. Elements will be re-ordered into ascending order.

Parameters

array:Vector.<String> — the char array to sort

sort7()method 
public static function sort7(array:Vector.<int>):void

Performs a sort on the given array. Elements will be re-ordered into ascending order.

Parameters

array:Vector.<int> — the byte array to sort

sort8()method 
public static function sort8(array:Vector.<Number>):void

Performs a sort on the given array. Elements will be re-ordered into ascending order.

Parameters

array:Vector.<Number> — the float array to sort

See also

sort9()method 
public static function sort9(array:Vector.<int>):void

Performs a sort on the given array. Elements will be re-ordered into ascending order.

Parameters

array:Vector.<int> — the short array to sort

sortBytesRange()method 
public static function sortBytesRange(array:Vector.<int>, start:int, end:int):void

Performs a sort on the section of the array between the given indices. Elements will be re-ordered into ascending order.

Parameters

array:Vector.<int> — the byte array to sort
 
start:int — the start index
 
end:int — the end index + 1


Throws
IllegalArgumentException — when start > end
 
RangeError — when start < 0 or end > array.size()
sortCharsRange()method 
public static function sortCharsRange(array:Vector.<String>, start:int, end:int):void

Performs a sort on the section of the array between the given indices. Elements will be re-ordered into ascending order.

Parameters

array:Vector.<String> — the char array to sort
 
start:int — the start index
 
end:int — the end index + 1


Throws
IllegalArgumentException — when start > end
 
RangeError — when start < 0 or end > array.size()
sortDoublesRange()method 
public static function sortDoublesRange(array:Vector.<Number>, start:int, end:int):void

Performs a sort on the section of the array between the given indices. Elements will be re-ordered into ascending order.

Parameters

array:Vector.<Number> — the double array to sort
 
start:int — the start index
 
end:int — the end index + 1


Throws
IllegalArgumentException — when start > end
 
RangeError — when start < 0 or end > array.size()

See also

sortFloatsRange()method 
public static function sortFloatsRange(array:Vector.<Number>, start:int, end:int):void

Performs a sort on the section of the array between the given indices. Elements will be re-ordered into ascending order.

Parameters

array:Vector.<Number> — the float array to sort
 
start:int — the start index
 
end:int — the end index + 1


Throws
IllegalArgumentException — when start > end
 
RangeError — when start < 0 or end > array.size()

See also

sortIntsRange()method 
public static function sortIntsRange(array:Vector.<int>, start:int, end:int):void

Performs a sort on the section of the array between the given indices. Elements will be re-ordered into ascending order.

Parameters

array:Vector.<int> — the int array to sort
 
start:int — the start index
 
end:int — the end index + 1


Throws
IllegalArgumentException — when start > end
 
RangeError — when start < 0 or end > array.size()
sortLongsRange()method 
public static function sortLongsRange(array:Vector.<LongImpl>, start:int, end:int):void

Performs a sort on the section of the array between the given indices. Elements will be re-ordered into ascending order.

Parameters

array:Vector.<LongImpl> — the long array to sort
 
start:int — the start index
 
end:int — the end index + 1


Throws
IllegalArgumentException — when start > end
 
RangeError — when start < 0 or end > array.size()
sortObjectsRange()method 
public static function sortObjectsRange(array:Vector.<Object>, start:int, end:int):void

Performs a sort on the section of the array between the given indices. Elements will be re-ordered into ascending order.

Parameters

array:Vector.<Object> — the Object array to sort
 
start:int — the start index
 
end:int — the end index + 1


Throws
TypeError — when an element in the array does not implement Comparable or elements cannot be compared to each other
 
IllegalArgumentException — when start > end
 
RangeError — when start < 0 or end > array.size()
sortObjectsRangeWithComparator()method 
public static function sortObjectsRangeWithComparator(array:Vector.<Object>, start:int, end:int, comparator:Comparator):void

Performs a sort on the section of the array between the given indices. Elements will be re-ordered into ascending order according to the given Comparator.

Parameters

array:Vector.<Object> — the Object array to sort
 
start:int — the start index
 
end:int — the end index + 1
 
comparator:Comparator — the Comparator


Throws
TypeError — when elements in the array cannot be compared to each other using the Comparator
 
IllegalArgumentException — when start > end
 
RangeError — when start < 0 or end > array.size()
sortShortsRange()method 
public static function sortShortsRange(array:Vector.<int>, start:int, end:int):void

Performs a sort on the given array. Elements will be re-ordered into ascending order.

Parameters

array:Vector.<int> — the short array to sort
 
start:int — the start index
 
end:int — the end index + 1


Throws
IllegalArgumentException — when start > end
 
RangeError — when start < 0 or end > array.size()