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]:[]}

Constructor

@:value({ excludes : null, includes : null })new(?includes:Dynamic, ?excludes:Dynamic)

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>

Parameters:

includes

The set of CbTypes to be included in the matching process. (default null)

excludes

The set of CbTypes to be excluded in the matching process. (default null)

Returns:

Return new OptionType with give sets of CbTypes.

Throws:

#

If either argument is not of the expected Type.

Variables

@:value(null)zpp_inner:ZPP_OptionType = null

@private

read onlyincludes: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)

read onlyexcludes: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)

Methods

@:value({ includes : null })including(?includes:Dynamic):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>

Parameters:

includes

The set of CbTypes to be included. (default null)

Returns:

A reference to this OptionType.

Throws:

#

If argument is not of the expected Type.

@:value({ excludes : null })excluding(?excludes:Dynamic):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>

Parameters:

excludes

The set of CbTypes to be excluded. (default null)

Returns:

A reference to this OptionType.

Throws:

#

If argument is not of the expected Type.

@:keeptoString():String

@private