Interface CodeTernaryExpression
- All Superinterfaces:
CodeExpression, CodeItem
CodeExpression for a ternary expression. Syntax:
«Example:(condition)» ? «if-arg» : «else-arg»
(x == 1) ? y : (z + 1)
- Since:
- 1.0.0
- Author:
- Joerg Hohwiller (hohwille at users.sourceforge.net)
-
Field Summary
Fields inherited from interface CodeItem
DEFAULT_INDENT, DEFAULT_NEWLINE -
Method Summary
Methods inherited from interface CodeItem
getLanguage, getSourceCode, write, write, write, write, write, write
-
Method Details
-
getCondition
CodeCondition getCondition()- Returns:
- the
CodeConditionthat decides about the result (if-argorelse-arg).
-
getIfArg
CodeExpression getIfArg()- Returns:
- the
CodeExpressionthat is evaluated as result if theconditionistrue.
-
getElseArg
CodeExpression getElseArg()- Returns:
- the
CodeExpressionthat is evaluated as result if theconditionisfalse.
-
evaluate
- Specified by:
evaluatein interfaceCodeExpression- Returns:
- this expression evaluated as
CodeConstantornullif not a constant expression. - See Also:
-