ArrayList~extras Class
Useful algorithms that are not provided by browsers. Available if Y.ArrayList (collection) is loaded.
Item Index
Methods
Methods
binarySearch
(
Int
-
target
Binary search, using the function passed to setComparator().
Parameters:
-
target
Mixedthe object to search for
Returns:
Int:
index of matched item or -1 if no match
quickSort
()
Quick sort the given list, using the function passed to setComparator().
setComparator
(
-
compare
Set comparison function.
Parameters:
-
compare
Functionthe -1,0,+1 comparison function to use when sorting and searching
swap
(
-
i
-
j
Swap two elements.
Parameters:
-
i
Intfirst index
-
j
Intsecond index