Packageweavejs.util
Classpublic class AsyncSort
InheritanceAsyncSort Inheritance Object
Implements ILinkableObject

Asynchronous merge sort.



Public Properties
 PropertyDefined By
  debug : Boolean = false
[static]
AsyncSort
  result : *
[read-only] This is the sorted Array (or Vector), or null if the sort operation has not completed yet.
AsyncSort
Public Methods
 MethodDefined By
  
abort():void
Aborts the current async sort operation.
AsyncSort
  
beginSort(arrayToSort:*, compareFunction:Function = null):void
This will begin an asynchronous sorting operation on the specified Array (or Vector).
AsyncSort
  
compareCaseInsensitive(a:String, b:String):int
[static] This function is a wrapper for StandardLib.stringCompare(a, b, true) (case-insensitive String compare).
AsyncSort
  
primitiveCompare(a:*, b:*):int
[static] Compares two primitive values.
AsyncSort
  
sortImmediately(array:*, compareFunction:Function = null):void
[static] This function will sort an Array (or Vector) immediately.
AsyncSort
  
test(compare:Object, testType:int = 0):void
[static]
AsyncSort
  
testSortOn(compare:Object, testType:int = 0):void
[static]
AsyncSort
Property Detail
debugproperty
public static var debug:Boolean = false

resultproperty 
result:*  [read-only]

This is the sorted Array (or Vector), or null if the sort operation has not completed yet.


Implementation
    public function get result():*
Method Detail
abort()method
public function abort():void

Aborts the current async sort operation.

beginSort()method 
public function beginSort(arrayToSort:*, compareFunction:Function = null):void

This will begin an asynchronous sorting operation on the specified Array (or Vector). Only one sort operation can be carried out at a time. Callbacks will be triggered when the sorting operation completes. The given Array (or Vector) will be modified in-place.

Parameters

arrayToSort:* — The Array (or Vector) to sort.
 
compareFunction:Function (default = null) — A function that compares two items and returns -1, 0, or 1.

See also

mx.utils.StandardLib.compare()
compareCaseInsensitive()method 
public static function compareCaseInsensitive(a:String, b:String):int

This function is a wrapper for StandardLib.stringCompare(a, b, true) (case-insensitive String compare).

Parameters

a:String
 
b:String

Returns
int
primitiveCompare()method 
public static function primitiveCompare(a:*, b:*):int

Compares two primitive values. This function is faster than StandardLib.compare(), but does not do deep object compare.

Parameters

a:*
 
b:*

Returns
int
sortImmediately()method 
public static function sortImmediately(array:*, compareFunction:Function = null):void

This function will sort an Array (or Vector) immediately.

Parameters

array:* — An Array (or Vector) to sort in place.
 
compareFunction:Function (default = null) — The function used to compare items in the array.

test()method 
public static function test(compare:Object, testType:int = 0):void

Parameters

compare:Object
 
testType:int (default = 0)

testSortOn()method 
public static function testSortOn(compare:Object, testType:int = 0):void

Parameters

compare:Object
 
testType:int (default = 0)