module:baja/comp/SlotCursor

module:baja/comp/SlotCursor

new (require("baja/comp/SlotCursor"))()

Description:
  • A Cursor used for Slot iteration.

Source:
See:
Extends:

Extends

Methods

actions() → {module:baja/comp/SlotCursor}

Description:
  • Adds a filter to the Cursor for Actions.

Source:
Returns:

itself.

Type
module:baja/comp/SlotCursor

dynamic() → {module:baja/comp/SlotCursor}

Description:
  • Adds a filter to the Cursor for dynamic Slots.

Source:
Returns:

itself.

Type
module:baja/comp/SlotCursor

each(func)

Description:
  • Iterate through the Cursor and call a function on every item.

    When the function is called, this refers to the context that
    was passed in when the Cursor was created.

Source:
Inherited From:
Parameters:
Name Type Description
func function

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.

eachDisplay(func)

Description:
  • Iterate through the Cursor and call 'each' on every Property Slot and
    get its display String.

    When the function is called, 'this' refers to the associated Complex and the argument
    is the display String.

Source:
Parameters:
Name Type Description
func function

function called on every iteration with the argument being a Property's display String

eachValue(func)

Description:
  • Iterate through the Cursor and call 'each' on every Property Slot and
    get its value.

    When the function is called, 'this' refers to the associated Complex
    and the argument is the value of the Property.

Source:
Parameters:
Name Type Description
func function

function called on every iteration with the
argument being a Property's value.

equalType(typeSpec) → {module:baja/comp/SlotCursor}

Description:
  • Adds a filter for Properties whose Type matches via equals.

    This method can take a variable number of TypeSpecs. If a variable number
    of TypeSpecs are specified then a slot will be filtered through if any of
    the TypeSpecs match (logical OR).

Source:
Parameters:
Name Type Description
typeSpec Type | String | Array

the TypeSpec to test against.

Returns:

itself.

Type
module:baja/comp/SlotCursor

equalValue(value) → {module:baja/comp/SlotCursor}

Description:
  • Adds a filter for Property values that match via equals.

    This method can take a variable number of values. If a variable number
    of values are specified then a slot will be filtered through if any of
    the values match (logical OR).

Source:
Parameters:
Name Type Description
value

the value to be used for equals.

Returns:

itself.

Type
module:baja/comp/SlotCursor

equivalent(value) → {module:baja/comp/SlotCursor}

Description:
  • Adds a filter for Property values that match via equivalent.

    This method can take a variable number of values. If a variable number of
    values are specified then a slot will be filtered through if any of the
    values match (logical OR).

Source:
Parameters:
Name Type Description
value

the value to be used for equivalent.

Returns:

itself.

Type
module:baja/comp/SlotCursor

filter(filter) → {baja.FilterCursor}

Description:
  • Add a filter function to the Cursor.

Source:
Inherited From:
Parameters:
Name Type Description
filter function

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:

itself.

Type
baja.FilterCursor

first()

Description:
  • 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.

Source:
Inherited From:
Returns:

first item found in the Cursor (or null if nothing found).

firstDisplay() → {String}

Description:
  • Return the first Property display String in the cursor (regardless of iterative state).

Source:
Returns:

first Property display String found in the Cursor (or null if nothing found).

Type
String

firstValue() → {baja.Value}

Description:
  • Return the first Property value in the cursor (regardless of iterative state).

Source:
Returns:

first Property value found in the Cursor (or null if nothing found).

Type
baja.Value

flags(flags) → {module:baja/comp/SlotCursor}

Description:
  • Adds a filter for Slots that match the requested Slot Flags.

Source:
See:
Parameters:
Name Type Description
flags Number

the Slot flags to be tested for.

Returns:

itself.

Type
module:baja/comp/SlotCursor

frozen() → {module:baja/comp/SlotCursor}

Description:
  • Adds a filter to the Cursor for frozen Slots.

Source:
Returns:

itself.

Type
module:baja/comp/SlotCursor

get()

Description:
  • Return the current item. If this is a
    SlotCursor, this will return a
    Slot.

Source:
Inherited From:
Returns:

the cursor value (null if none available).

getDisplay() → {String}

Description:
  • If the Slot is a Property, return its display String (otherwise return null).

Source:
Returns:

display String.

Type
String

getSize() → {Number}

Description:
  • Return the size of the cursor (regardless of iterative state).

Source:
Inherited From:
Returns:
Type
Number

getValue()

Description:
  • If the Slot is a Property, return its value (otherwise return null).

Source:
Returns:

a Property value.

is(typeSpec) → {module:baja/comp/SlotCursor}

Description:
  • Adds a filter for Property values that match the TypeSpec via Type#is.

    This method can take a variable number of TypeSpecs. If a variable
    number of TypeSpecs are specified then a slot will be filtered through
    if any of the TypeSpecs match (logical OR).

Source:
See:
Parameters:
Name Type Description
typeSpec Type | String

the TypeSpec to test against.

Returns:

itself.

Type
module:baja/comp/SlotCursor

isComplex() → {module:baja/comp/SlotCursor}

Description:
  • Adds a filter for Property values that are of Type baja:Complex
    (Type#isComplex).

Source:
See:
Returns:

itself.

Type
module:baja/comp/SlotCursor

isComponent() → {module:baja/comp/SlotCursor}

Description:
  • Adds a filter for Property values that are of Type baja:Component
    (Type#isComponent).

Source:
See:
Returns:

itself.

Type
module:baja/comp/SlotCursor

isEmpty() → {Boolean}

Description:
  • Return true if the Cursor is completely empty (regardless of iterative state).

Source:
Inherited From:
Returns:
Type
Boolean

isNumber() → {module:baja/comp/SlotCursor}

Description:
  • Adds a filter for Property values that are of Type baja:Number
    (Type#isNumber).

Source:
See:
Returns:

itself.

Type
module:baja/comp/SlotCursor

isSimple() → {module:baja/comp/SlotCursor}

Description:
  • Adds a filter for Property values that are of Type baja:Simple
    (Type#isSimple).

Source:
See:
Returns:

itself.

Type
module:baja/comp/SlotCursor

isStruct() → {module:baja/comp/SlotCursor}

Description:
  • Adds a filter for Property values that are of Type baja:Struct
    (Type#isStruct).

Source:
See:
Returns:

itself.

Type
module:baja/comp/SlotCursor

isValue() → {module:baja/comp/SlotCursor}

Description:
  • Adds a filter for Property values that are of Type baja:Value
    (Type#isValue).

Source:
See:
Returns:

itself.

Type
module:baja/comp/SlotCursor

last()

Description:
  • 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.

Source:
Inherited From:
Returns:

last item found in the Cursor (or null if nothing found).

lastDisplay() → {String}

Description:
  • Return the last Property display String in the cursor (regardless of iterative state).

Source:
Returns:

last Property display String found in the Cursor (or null if nothing found).

Type
String

lastValue() → {baja.Value}

Description:
  • Return the last Property value in the cursor (regardless of iterative state).

Source:
Returns:

first Property value found in the Cursor (or null if nothing found).

Type
baja.Value

next() → {Boolean}

Description:
  • Advance cursor and return true if successful.

Source:
Inherited From:
Returns:
Type
Boolean

properties() → {module:baja/comp/SlotCursor}

Description:
  • Adds a filter to the Cursor for Properties.

Source:
Returns:

itself.

Type
module:baja/comp/SlotCursor

slotName(slotName) → {module:baja/comp/SlotCursor}

Description:
  • Adds a filter for Slots that match the given Slot name.

Source:
Parameters:
Name Type Description
slotName String | RegExp

a String or Regular Expression for
matching Slots via name.

Returns:

itself.

Type
module:baja/comp/SlotCursor

toArray() → {Array}

Description:
  • Return an array of the cursor results (regardless of iterative state).
    If this is a Slot Cursor, this will be an array of Slots.

Source:
Inherited From:
Returns:
Type
Array

toDisplayArray() → {Array.<String>}

Description:
  • Return an array of Property display Strings (regardless of iterative state).

Source:
Returns:
Type
Array.<String>

toDisplayMap() → {Object}

Description:
  • Return an Object Map of Property names with their corresponding display
    Strings (regardless of iterative state).

Source:
Returns:
Type
Object

toMap() → {Object}

Description:
  • 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).

Source:
Inherited From:
Returns:
Type
Object

toValueArray() → {Array.<baja.Value>}

Description:
  • Return an array of Property values (regardless of iterative state).
    This will call get() on each slot in the cursor, so please see the
    get() documentation for performance notes.

Source:
See:
Returns:
Type
Array.<baja.Value>

toValueMap() → {Object}

Description:
  • Return an Object Map of Property names with their corresponding
    values (regardless of iterative state).

Source:
Returns:
Type
Object

topics() → {module:baja/comp/SlotCursor}

Description:
  • Adds a filter to the Cursor for Topics.

Source:
Returns:

itself.

Type
module:baja/comp/SlotCursor