org.databene.benerator.script
Class ConditionalExpression<E>

java.lang.Object
  extended by org.databene.commons.expression.DynamicExpression<E>
      extended by org.databene.benerator.script.ConditionalExpression<E>
All Implemented Interfaces:
org.databene.commons.Expression<E>

public class ConditionalExpression<E>
extends org.databene.commons.expression.DynamicExpression<E>

Expression implementation that evaluates a boolean (condition) expression and, depending if the result was true or false, evaluates the first or second expression delegate. The semantic is like the Java expression (condition ? alt1 : alt2).

Created at 06.10.2009 16:04:15

Since:
0.6.0
Author:
Volker Bergmann

Constructor Summary
ConditionalExpression(org.databene.commons.Expression<java.lang.Boolean> condition, org.databene.commons.Expression<? extends E> alt1, org.databene.commons.Expression<? extends E> alt2)
           
 
Method Summary
 E evaluate(org.databene.commons.Context context)
           
 java.lang.String toString()
           
 
Methods inherited from class org.databene.commons.expression.DynamicExpression
isConstant
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

ConditionalExpression

public ConditionalExpression(org.databene.commons.Expression<java.lang.Boolean> condition,
                             org.databene.commons.Expression<? extends E> alt1,
                             org.databene.commons.Expression<? extends E> alt2)
Method Detail

evaluate

public E evaluate(org.databene.commons.Context context)

toString

public java.lang.String toString()
Overrides:
toString in class java.lang.Object


Copyright © 2011. All Rights Reserved.