Class: OrderedList

OrderedList

new OrderedList()

todoc
Source:

Members

(readonly) count :int

The number of items in the OrderedList
Type:
  • int
Source:

Methods

add(item, orderIDopt) → {OrderedList}

Adds an item to the OrderedList
Parameters:
Name Type Attributes Description
item *
orderID int <optional>
Source:
Returns:
OrderedList
this

addAfter(item, reference) → {OrderedList}

Adds an item to the OrderedList exactly after the given reference item
Parameters:
Name Type Description
item *
reference *
Source:
Returns:
OrderedList
this

addBefore(item, reference) → {OrderedList}

Adds an item to the OrderedList exactly before the given reference item
Parameters:
Name Type Description
item *
reference *
Source:
Returns:
OrderedList
this

all() → {Array}

Returns an array of all the items
Source:
Returns:
Array

clear() → {OrderedList}

Removes all items from the OrderedList
Source:
Returns:
OrderedList
this

each(callback, thisArgopt) → {OrderedList}

Executes a provided callback function once per item in ascending order
Parameters:
Name Type Attributes Description
callback function
thisArg * <optional>
Source:
Returns:
OrderedList
this

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>
Source:
Returns:
*

first() → (nullable) {*}

Returns the first element of the lowest orderID
Source:
Returns:
*

firstID() → (nullable) {int}

Returns the lowest orderID of the OrderedList
Source:
Returns:
int

getOrderOf(item) → (nullable) {int}

Returns the orderID of the given item
Parameters:
Name Type Description
item *
Source:
Returns:
int

getOrders() → {Array}

Returns an array of all the orderIDs in ascending order
Source:
Returns:
Array

has(item) → {Boolean}

Checks if the OrderedList contains a specific item
Parameters:
Name Type Description
item *
Source:
Returns:
Boolean

last() → (nullable) {*}

Returns the last element of the highest orderID
Source:
Returns:
*

lastID() → (nullable) {int}

Returns the highest orderID of the OrderedList
Source:
Returns:
int

remove(item) → (nullable) {*}

Removes an item from the OrderedList
Parameters:
Name Type Description
item *
Source:
Returns:
*
removed

reOrder(item, orderID) → {OrderedList}

Changes the place of the given item to the given order
Parameters:
Name Type Description
item *
orderID int
Source:
Returns:
OrderedList
this

toString() → {String}

Returns the string value of the orderedList
Source:
Returns:
String