API Docs for: 1.0.0
Show:

ArrayList~extras Class

Useful algorithms that are not provided by browsers. Available if Y.ArrayList (collection) is loaded.

Methods

binarySearch

(
  • target
)
Int

Binary search, using the function passed to setComparator().

Parameters:

  • target Mixed

    the 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 Function

    the -1,0,+1 comparison function to use when sorting and searching

swap

(
  • i
  • j
)

Swap two elements.

Parameters:

  • i Int

    first index

  • j Int

    second index