The builtin type sortedList.
SortedLists keep a list in sorted order. Either using the Compare method
of the item or an explicitly specified sort method.
This is similar to a priority queue. However, the order is determined by
the items themselves, not by a separately provided priority.
The sorting only happens when an item is added. When an item is modified
it needs to be removed and added back to update the sort order.
|
NEW() @public | Create a new empty sortedList.
|
|
NEW(items) @public | Create a new sortedList from a list of items.
|
|
$Size()
int @public | Return the number of items in the sortedList.
|
|
$ToString()
string @public | Return a string representation of the sortedList.
|
|
$copy()
SortedList<Titem> @public | Return a copy of the sortedList.
|
|
$Iterator()
I.Iterator<Titem> @public | Get an iterator to go over the items in sorted order.
|
|
$KeyIterator()
I.KeyIterator<int, Titem> @public | Get a key iterator to go over the items in sorted order.
|
|
$getList()
list<Titem> @public | Return the ordinary list with the items.
|
|
$setSortMethod(method) @public | Set the method to use for comparing two items.
|
|
$get(index)
Titem @public | Return the item at position index.
|
|
$set(index, value)
SortedList<Titem> @public | Set the item at index.
|
|
$slice(start)
list<Titem> @public | Create a new list with all items starting at start.
|
|
$slice(start, end)
list<Titem> @public | Create a new list with all items starting at start to end
(inclusive).
|
|
$sliceSize(start, length)
list<Titem> @public | Create a new list with all items starting at start with up to
length items.
|
|
$sliceWrap(start)
list<Titem> @public | Create a new list with all items starting at start.
|
|
$sliceWrap(start, end)
list<Titem> @public | Create a new list with all items starting at start to end
(inclusive).
|
|
$sliceWrapSize(start, length)
list<Titem> @public | Create a new list with all items starting at start with up to
length items.
|
|
$add(item)
SortedList<Titem> @public | Add an item to the sortedList.
|
|
$add(item, index)
SortedList<Titem> @public | Add an item to the sortedList. Identical to add(item).
|
|
$insert(item)
SortedList<Titem> @public | Add an item to the sortedList. Identical to add(item).
|
|
$insert(item, index)
SortedList<Titem> @public | Add an item to the sortedList. Identical to add(item).
|
|
$clear()
SortedList<Titem> @public | Make the sortedList empty.
|
|
$clear(index)
SortedList<Titem> @public | Remove an item at index from the sortedList. and return the
sortedList.
|
|
$remove()
Titem @public | Removes the last item from the list and returns it.
|
|
$remove(index)
Titem @public | Removes the item at index from the sortedList and returns it.
|
|
$remove(from, to)
list<Titem> @public | Removes items from to to (inclusive) from the list and returns them
in a new list.
|
|
$extend(items)
SortedList<Titem> @public | Add a all items of list items to this sortedList.
|
|
$extend(items)
SortedList<Titem> @public | Add a all items of sortedList items to this sortedList.
|
|
$concat(other)
SortedList<Titem> @public | Create a new list with all items of this list and list other
|
|
$concat(other)
SortedList<Titem> @public | Create a new list with all items of this list and sortedList other
|
|
$has(item)
bool @public | Check if an item is present in the sortedList.
|
|
$find(item)
int @public | Return the index of item in the sortedList.
|
|
$join()
string @file | Return all items converted to a string and concatenated, separated by a
single space.
|
|
$join(sep)
string @file | Return all items converted to a string and concatenated, separated by
sep.
|
|
$sort()
SortedList<Titem> @public | Ensures that the items are sorted.
|
|
$map(f)
SortedList<Titem> @public | Execute function f on each item. Each item is replaced by the result
of the function.
|
|
$keyMap(f)
SortedList<Titem> @public | Execute function f on each item. Each item is replaced by the result
of the function.
|
|
$mapTo<Tresult>(f)
SortedList<Tresult> @public | Create a new sortedList where each item is the result of executing
function f on each item of this sortedList.
|
|
$keyMapTo<Tresult>(f)
SortedList<Tresult> @public | Create a new sortedList where each item is the result of executing
function f on each item of this sortedList.
|
|
$forEach(f)
sortedList<Titem> @public | Call method f for every item in the sortedList.
|
|
$forKeyEach(f)
sortedList<Titem> @public | Call method f for every item in the sortedList.
|
|
$reduce(f)
Titem @public | Execute function f on each item to collect a result value.
|
|
$reduce(init, f)
Titem @public | Execute function f on each item to collect a result value.
|
|
$reduceTo<Tresult>(init, f)
Tresult @public | Execute function f on each item to collect a result value.
|
|
Included from BOX.ByItem:
|
|
$removeItem(item)
Titem @public | Remove item and return it.
|
|
$clearItem(item)
THIS @public | Remove item and return THIS.
|
|
Included from BOX.MaxMin:
|
|
$max()
Titem @public | Return the maximum value in the Box.
|
|
$min()
Titem @public | Return the minimum value in the Box.
|
|