SortedList Class
extended array of objects, always sorted
Item Index
Properties
Methods
bsearch
(
Number
-
val
binary search
Parameters:
-
val
Any
Returns:
Number:
position of the value
compare
(
private
-
a
-
b
comparison function. Compares two objects by this.compareKey
Parameters:
-
a
Any -
b
Any
firstPositionOf
(
Number
-
val
leftmost position of the given val
Parameters:
-
val
Any
Returns:
Number:
leftmost position of the value
insert
(
Number
-
val
insert a value
Parameters:
-
val
Any
Returns:
Number:
inserted position
lastPositionOf
(
Number
-
val
rightmost position of the given val
Parameters:
-
val
Any
Returns:
Number:
rightmost position of the value
max
()
Number
get maximum value in the list
Returns:
Number:
min
()
Number
get minimum value in the list
Returns:
Number:
remove
(
SortedList
-
pos
remove the value in the given position
Parameters:
-
pos
Numberposition
Returns:
SortedList:
self
Properties
compareKey
String
key name to compare objects. The value of the key must be a number.