Class baja.FilterCursor
Extends
baja.SyncCursor.
A filtered cursor used for iteration.
This Cursor is a generic Cursor used for iteration in a baja.OrderedMap.
Defined in: sys.js.
| Constructor Attributes | Constructor Name and Description |
|---|---|
| Method Attributes | Method Name and Description |
|---|---|
|
each(func)
Iterate through the Cursor and call 'each' on every item.
|
|
|
filter(filter)
Add a filter function to the Cursor.
|
|
|
first()
Return the first item in the cursor (regardless of iterative state).
|
|
|
get()
Return the current item.
|
|
| <private> |
getIndex()
Return the current index
This is a private method and shouldn't be used by non-Tridium developers. |
| <private> |
getKey()
Return the current key.
|
|
getSize()
Return the size of the cursor (regardless of iterative state).
|
|
|
isEmpty()
Return true if the Cursor is completely empty (regardless of iterative state).
|
|
|
last()
Return the last item in the cursor (regardless of iterative state).
|
|
|
next()
Advance cursor and return true if successful.
|
|
|
toArray()
Return an array of the cursor results (regardless of iterative state).
|
|
|
toMap()
Return an Object Map of keys with their corresponding values.
|
When the function is called, 'this' refers to the 'context' that was passed in when the Cursor was created.
- Parameters:
- {Function} func
- function called on every iteration with the 'value' being used as an argument. If this is a Slot Cursor the 'value' will be a Slot.
- Parameters:
- {Function} filter
- used to filter the results of the Cursor. When invoked, the first argument will be the item to filter (i.e. a Slot). This function must return a true value for the item to be kept.
- Returns:
- {baja.FilterCursor} itself.
If this is being used as a Slot Cursor, the Slot will be returned.
- Returns:
- first item found in the Cursor (or null if nothing found).
- Returns:
- the cursor value (null if none available).
This is a private method and shouldn't be used by non-Tridium developers.
- Returns:
- {Number} the cursor index (null if none available).
This is a private method and shouldn't be used by non-Tridium developers.
- Returns:
- {String} the cursor key (null if none available).
- Returns:
- {Number}
- Returns:
- {Boolean}
If this is being used as a Slot Cursor, the Slot will be returned.
- Returns:
- last item found in the Cursor (or null if nothing found).
- Returns:
- {Boolean}
- Returns:
- {Array}
- Returns:
- {Object}