class nape.callbacks.OptionType

Available on all platforms

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 Fields

var 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 []

var 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 []

function 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> * *

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

function 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> * *

excludes

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

returns

A reference to this OptionType. *

function 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> * *

includes

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

returns

A reference to this OptionType. *

function toString():String

@private