OptionType

nape.callbacks.OptionType (final class)

OptionType representing matching behaviour for Listeners.

An object's set of CbType's 'matches' against an OptionType iff. the OptionType's includes list intersects the object's set of CbTypes and the OptionType's excludes list 'does not' intersect the object's set of CbTypes.

option = new OptionType([A, B], [C, D]);
obj.cbTypes = [] // => does not match option.
obj.cbTypes = [A] // => matches the option
obj.cbTypes = [A, C] // => does not match option.

The optionType's includes and excludes list are managed to be always disjoint: The action of including an already excluded type serves to remove it from the excludes list, equalliy excluding an already included type serves to remove it from the includes list.

var option = new OptionType();
option.including(A); // option = {[A]:[]}
option.excluding(A); // option = {[]:[]}
option.excluding(A); // option = {[]:[A]}
option.including(A); // option = {[A]:[]}

Instance Members

@private


nape
includes: CbTypeList

List of included CbTypes.

This list is both readonly, and immutable. To remove an element from this list you can use: option.excluding(cbType)

@default []


nape
excludes: CbTypeList

List of excluded CbTypes.

This list is both readonly, and immutable. To remove an element from this list you can use: option.including(cbType)

@default []


nape
including(?includes: Dynamic = null): OptionType

Append set of types to includes list.

This method was originally named the more appropriate 'include' but this conflicted with the AS3 keyword include and had to be change.

The argument is typed Dynamic, and is permitted to be one of: CbType, CbTypeList, Array<CbType> flash.Vector<CbType>

Name Type Default Description
includes Dynamic null The set of CbTypes to be included. (default null)
Returns Description
OptionType A reference to this OptionType.

nape
excluding(?excludes: Dynamic = null): OptionType

Append set of types to excludes list.

This method was originally named the more appropriate 'exclude' but to match the necessary change for the include function, this was renamed as excluding.

The argument is typed Dynamic, and is permitted to be one of: CbType, CbTypeList, Array<CbType> flash.Vector<CbType>

Name Type Default Description
excludes Dynamic null The set of CbTypes to be excluded. (default null)
Returns Description
OptionType A reference to this OptionType.

nape
toString(): String

@private

Returns
String

nape
new(?includes: Dynamic = null, ?excludes: Dynamic = null): Void

Construct a new OptionType.

The type of the arguments is Dynamic, and is permitted to be one of: CbType, CbTypeList, Array<CbType> flash.Vector<CbType>

Name Type Default Description
includes Dynamic null The set of CbTypes to be included in the matching process. (default null)
excludes Dynamic null The set of CbTypes to be excluded in the matching process. (default null)

Private Members

Metadata

Name Parameters
:final -