Class: MultiEvaluator

system.evaluators. MultiEvaluator


new MultiEvaluator( [elements])

This Evaluable combine a collection of evaluators to evaluates a specified value.

This Evaluable combine a collection of evaluators to evaluates a specified value.

Parameters:
Name Type Argument Description
elements array <optional>

An optional array of evaluators to group.

Example
var MultiEvaluator    = system.evaluators.MultiEvaluator ;
var PropertyEvaluator = system.evaluators.PropertyEvaluator ;
var RomanEvaluator    =  system.evaluators.RomanEvaluator ;

var obj = { id  : "XII" , count : 100 } ;

var evaluator1 = new PropertyEvaluator( obj ) ;
var evaluator2 = new RomanEvaluator() ;

var evaluator = new MultiEvaluator() ;

evaluator.add( evaluator1 ) ;
evaluator.add( evaluator2 ) ;

trace( evaluator.eval( 'id' ) ) ; // 12
trace( evaluator.eval( 'count' ) ) ; // C

Extends

Members


autoClear :boolean

Indicates if the MultiEvaluator is cleared before insert new Evaluable objects (in the add method).

Type:
  • boolean
Default Value:
  • false

<readonly> length :number

Indicates the number of elements registered in this collection.

Type:
  • number

Methods


add(evaluators)

Inserts an Evaluable objects in the MultiEvaluator.

Parameters:
Name Type Argument Description
evaluators system.Evaluable <repeatable>

The enumeration list of Evaluable objets or Arrays of Evaluator. Only Array and Evaluable are compatible to fill the MultiEvaluator.


clear()

Clear all the Evaluable objects.


eval(value)

Evaluates the specified object.

Parameters:
Name Type Description
value *

The object to evaluates.

Overrides:
Returns:

The result of the evaluation.


remove(evaluator)

Removes an Evaluable objects in the MultiEvaluator if is register.

Parameters:
Name Type Description
evaluator

The Evaluable to find and remove.

Returns:

true if the Evaluable is removed.


toString()

Returns the string representation of this instance.

Overrides:
Returns:

the string representation of this instance.