<abstract, protected> new AbstractList( [valueType] [, context])
Creates a new AbstractList of the specified type.
Parameters:
| Name | Type | Argument | Description |
|---|---|---|---|
valueType |
function |
<optional> |
Constructor for the value of the entries |
context |
olympe.df.ExecutionContext |
<optional> |
Optional execution context. |
- Implements:
Extends
Members
-
<protected> orderedKeys :Array
-
Type:
- Array
-
<protected> ranks :Object.<string, number>
-
Type:
- Object.<string, number>
Methods
-
_clear()
-
Removes all values from the map.
-
<protected> _removeRank(key)
-
Remove the rank associated to a key/value pair. Use in conjunction with _remove().
Parameters:
Name Type Description keystring Key of the item
-
<protected> _setRank(key, rank)
-
Update an item's rank and related proxies.
Parameters:
Name Type Description keystring ranknumber -
<protected> _updateOrderedItems()
-
Updates the ordered items array if needed
-
_updateSize()
-
Refreshes the size proxy.
-
dump()
-
Gets a debug string representation of the content of the list (at the time of the method call)
Returns:
- Type
- string
-
forEachCurrentValue()
-
Executes the specified callback on each current item ordered by rank. Notes:
- This method does not create a node for each callback call. It is just a simple iteration on all values present in the enumerable at the time of the method call.
- It is possible to break out of the iteration by having the callback return
false.
-
forEachLimited(start, count, onAdd [, onRemove])
-
Registers callbacks to be called every time an entry whose rank is greater than or equal to start and smaller than start plus count is added or removed from this collection.
Note: If the collection is not empty, the 'onAdd' callback will be invoked for each existing entry.
Parameters:
Name Type Argument Description startolympe.df.PONumber | number starting rank for the selection
countolympe.df.PONumber | number number of entries in the selection
onAddfunction The callback to invoke when an entry is added.
onRemovefunction <optional>
The callback to invoke when an entry is removed.
-
getAt(rank)
-
Gets the value of the entry at the specified rank.
Parameters:
Name Type Description rankolympe.df.PONumber | number the rank of the entry
Returns:
the value of the entry at that rank
- Type
- olympe.df.Proxy.<T> | T
-
getCurrentAt(rank)
-
Gets the value of the entry at the specified rank at the time of the method call.
Parameters:
Name Type Description rankolympe.df.ONumber | number the rank of the entry
Returns:
the value of the entry at that rank
- Type
- T | undefined
-
getCurrentKeyAt(rank)
-
Gets the key of the item at the specified rank at the time of the method call.
Parameters:
Name Type Description rankolympe.df.ONumber | number the rank of the entry
Returns:
the key of the entry at that rank
- Type
- string | undefined
-
getCurrentRank()
-
Gets the rank of the specified entry at the time of the method call.
-
getFirst()
-
Gets the value of the first entry in the list.
Returns:
the value of the first entry.
- Type
- olympe.df.Proxy.<T> | T
-
getFirstKey()
-
Gets the key for the first entry in the list.
Returns:
the number of key-value mappings in this list.
- Type
- olympe.df.Proxy.<string> | string
-
getKeyAt(rank)
-
Gets the key of the entry at the specified rank.
Parameters:
Name Type Description rankolympe.df.PONumber | number the rank of the entry
Returns:
the key of the entry at that rank
- Type
- olympe.df.Proxy.<string> | string
-
getKeys()
-
Gets an array containing all the keys ordered by rank.
Returns:
an Array of the keys
- Type
- Array | olympe.df.Proxy
-
getRank(key)
-
Gets the rank of of the entry associated with a specific key.
Parameters:
Name Type Description keyolympe.df.POString | string the key of the entry
Returns:
the rank of the entry
- Type
- olympe.df.PONumber
-
setValueType()
-
Olympe SDK