MetaDone
metadone.client.grasyla2.generic.IfEngine Class Reference
Inheritance diagram for metadone.client.grasyla2.generic.IfEngine:
Collaboration diagram for metadone.client.grasyla2.generic.IfEngine:

List of all members.

Public Member Functions

 IfEngine (GrasylaContext context, ConcreteObject expression, Engine parent) throws BadPreCondition

Protected Member Functions

boolean isNativeAttribute (String name)
void notifyChildChanged (Engine child, ChildComponent comp)

Package Functions

protected< C > Component
<?extends C > 
buildNewComponent (Class< C > clComp) throws BadPreCondition
private< C > Component<?extends C > evaluate (Class< C > clComp) throws BadPreCondition
private< C > Component<?extends C > evaluateSimple (Class< C > clComp, int skipCount) throws BadPreCondition
private< C > Component<?extends C > rebuildAll (Class< C > clComp) throws BadPreCondition

Private Member Functions

void rebuildSingle (Engine child, ChildComponent comp, Class<?> cl) throws BadPreCondition

Private Attributes

boolean all = false
volatile boolean evaluating
volatile int trueIndex

Static Private Attributes

static final String ATTR_ALL = "all"

Detailed Description

A conditional engine.

Attributes

Contents

Should be GuardEngines. If the indicator GuardEngine#FALSE_INDICATOR is not present in the child component, it means that is has been evaluated to true. It means that other components than guard are true by default, however a guard without a condition should be used in such case.

Result
There are two cases; when building the `all` attribute is evaluated only once. If `all` is true: all the guards are evaluated and true guards are concatenated to build the result. Otherwise, only the component of the first true guard is returned. In the later case, guards that are after the currently true guard are not activated nor evaluated which allows a more lazy approach.
Author:
kma
See also:
GuardEngine

Constructor & Destructor Documentation

metadone.client.grasyla2.generic.IfEngine.IfEngine ( GrasylaContext  context,
ConcreteObject  expression,
Engine  parent 
) throws BadPreCondition

Initializes this engine.

Parameters:
contextThe context
expressionThe expression
parentThe parent or null
Exceptions:
BadPreCondition

References metadone.client.grasyla2.GrasylaEngine.context, metadone.client.grasyla2.GrasylaEngine.expression, and metadone.client.grasyla2.GrasylaEngine.parent.


Member Function Documentation

protected<C> Component<? extends C> metadone.client.grasyla2.generic.IfEngine.buildNewComponent ( Class< C >  clComp) throws BadPreCondition [package, virtual]
boolean metadone.client.grasyla2.generic.IfEngine.isNativeAttribute ( String  name) [protected]

Indicates whether an attribute is handled when building the component.

In other words, a native attribute should not be handled by an attribute handler.

Parameters:
nameThe name of the attribute
Returns:
true if name is a native attribute

Reimplemented from metadone.client.grasyla2.GrasylaEngine.

References metadone.client.grasyla2.generic.IfEngine.ATTR_ALL.


Member Data Documentation


The documentation for this class was generated from the following file:
 All Classes Namespaces Files Functions Variables Enumerations