Members
Methods
add(item, orderIDopt) → {OrderedList}
Adds an item to the OrderedList
Parameters:
Name | Type | Attributes | Description |
---|---|---|---|
item |
* | ||
orderID |
int |
<optional> |
Returns:
OrderedListthis
addAfter(item, reference) → {OrderedList}
Adds an item to the OrderedList exactly after the given reference item
Parameters:
Name | Type | Description |
---|---|---|
item |
* | |
reference |
* |
Returns:
OrderedListthis
addBefore(item, reference) → {OrderedList}
Adds an item to the OrderedList exactly before the given reference item
Parameters:
Name | Type | Description |
---|---|---|
item |
* | |
reference |
* |
Returns:
OrderedListthis
each(callback, thisArgopt) → {OrderedList}
Executes a provided callback function once per item in ascending order
Parameters:
Name | Type | Attributes | Description |
---|---|---|---|
callback |
function | ||
thisArg |
* |
<optional> |
Returns:
OrderedListthis
execute(callback, thisArgopt) → (nullable) {*}
Executes a provided callback function once per item in descending, stops when the callback's return value is not undefined and returns
Parameters:
Name | Type | Attributes | Description |
---|---|---|---|
callback |
function | ||
thisArg |
* |
<optional> |
Returns:
*first() → (nullable) {*}
Returns the first element of the lowest orderID
Returns:
*firstID() → (nullable) {int}
Returns the lowest orderID of the OrderedList
Returns:
intgetOrderOf(item) → (nullable) {int}
Returns the orderID of the given item
Parameters:
Name | Type | Description |
---|---|---|
item |
* |
Returns:
intgetOrders() → {Array}
Returns an array of all the orderIDs in ascending order
Returns:
Arrayhas(item) → {Boolean}
Checks if the OrderedList contains a specific item
Parameters:
Name | Type | Description |
---|---|---|
item |
* |
Returns:
Booleanlast() → (nullable) {*}
Returns the last element of the highest orderID
Returns:
*lastID() → (nullable) {int}
Returns the highest orderID of the OrderedList
Returns:
intremove(item) → (nullable) {*}
Removes an item from the OrderedList
Parameters:
Name | Type | Description |
---|---|---|
item |
* |
Returns:
*removed
reOrder(item, orderID) → {OrderedList}
Changes the place of the given item to the given order
Parameters:
Name | Type | Description |
---|---|---|
item |
* | |
orderID |
int |
Returns:
OrderedListthis