com.wewebu.expression.language
Class OwExprConditionalExpression

java.lang.Object
  extended by com.wewebu.expression.language.OwExprExpression
      extended by com.wewebu.expression.language.OwExprConditionalExpression

public class OwExprConditionalExpression
extends OwExprExpression

The short conditional expression parsing result :
1+b>a?'ok':'nok'
1+b>a is the test expression
'ok' is the true expression
'nok' is the false expression

Alfresco Workdesk
Copyright (c) Alfresco Software, Inc.
All rights reserved.

For licensing information read the license.txt file or
go to: http://wiki.alfresco.com


Field Summary
 
Fields inherited from class com.wewebu.expression.language.OwExprExpression
m_errorTable, m_symbolTable, m_typeError
 
Constructor Summary
OwExprConditionalExpression(OwExprSymbolTable symbolTable_p, OwExprErrorTable errorTable_p, OwExprExpression test_p, OwExprExpression trueExpression_p, OwExprExpression falseExpression_p)
          Constructor
 
Method Summary
 OwExprValue evaluate(OwExprScope scope_p)
          Evaluates this expression :
If the m_test expression results in a OwExprBooleanValue equal to OwExprBooleanValue.TRUE than the m_trueExpression is evaluated end the result returned otherwise the m_falseExpression expression is evaluated and the result returned.
 String toString()
           
 OwExprExpressionType type()
          Type check method.
 
Methods inherited from class com.wewebu.expression.language.OwExprExpression
errCount, evaluate, evaluate, getErrorTable, getSymbol, getSymbolTable, hasErrors, initType, symbolsVisibleInScopes
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

OwExprConditionalExpression

public OwExprConditionalExpression(OwExprSymbolTable symbolTable_p,
                                   OwExprErrorTable errorTable_p,
                                   OwExprExpression test_p,
                                   OwExprExpression trueExpression_p,
                                   OwExprExpression falseExpression_p)
Constructor

Parameters:
symbolTable_p - the global symbol table
errorTable_p - the global error table
test_p - the test expression
trueExpression_p - the true branch expression
falseExpression_p - the false branch expression
Method Detail

evaluate

public OwExprValue evaluate(OwExprScope scope_p)
                     throws OwExprEvaluationException
Evaluates this expression :
If the m_test expression results in a OwExprBooleanValue equal to OwExprBooleanValue.TRUE than the m_trueExpression is evaluated end the result returned otherwise the m_falseExpression expression is evaluated and the result returned.

Specified by:
evaluate in class OwExprExpression
Parameters:
scope_p -
Returns:
the short conditional evaluation result
Throws:
OwExprEvaluationException

type

public OwExprExpressionType type()
                          throws OwExprTypeMissmatchException
Type check method. If type errors are encountered during type computation the OwExprExpression.m_typeError should be set to true . The type check is also forced on all dependent expressions m_test,m_trueExpression and m_falseExpression.

Specified by:
type in class OwExprExpression
Returns:
the expression type for this expression
Throws:
OwExprTypeMissmatchException - if type errors are encountered during type computation

toString

public String toString()
Overrides:
toString in class Object


Copyright © 2013 Alfresco Business Solutions. All Rights Reserved.