Class Index | File Index

Classes


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.

Class Summary
Constructor Attributes Constructor Name and Description
 
Method Summary
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.
 
Return the first item in the cursor (regardless of iterative state).
 
get()
Return the current item.
<private>  
Return the current index

This is a private method and shouldn't be used by non-Tridium developers.

<private>  
Return the current key.
 
Return the size of the cursor (regardless of iterative state).
 
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.
 
Return an array of the cursor results (regardless of iterative state).
 
Return an Object Map of keys with their corresponding values.
Class Detail
baja.FilterCursor()
See:
baja.OrderedMap
Method Detail
each(func)
Iterate through the Cursor and call 'each' on every item.

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.

{baja.FilterCursor} filter(filter)
Add a filter function to the Cursor.
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.

first()
Return the first item in the cursor (regardless of iterative state).

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).

get()
Return the current item. If this is a SlotCursor, this will return a Slot.
Returns:
the cursor value (null if none available).

<private> {Number} getIndex()
Return the current index

This is a private method and shouldn't be used by non-Tridium developers.

Returns:
{Number} the cursor index (null if none available).

<private> {String} getKey()
Return the current key.

This is a private method and shouldn't be used by non-Tridium developers.

Returns:
{String} the cursor key (null if none available).

{Number} getSize()
Return the size of the cursor (regardless of iterative state).
Returns:
{Number}

{Boolean} isEmpty()
Return true if the Cursor is completely empty (regardless of iterative state).
Returns:
{Boolean}

last()
Return the last item in the cursor (regardless of iterative state).

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).

{Boolean} next()
Advance cursor and return true if successful.
Returns:
{Boolean}

{Array} toArray()
Return an array of the cursor results (regardless of iterative state). If this is a Slot Cursor, this will be an array of Slots.
Returns:
{Array}

{Object} toMap()
Return an Object Map of keys with their corresponding values. If this is a Slot Cursor, this will be a Map of Slot names with their corresponding Slots (regardless of iterative state).
Returns:
{Object}

Documentation generated by JsDoc Toolkit 2.3.2