Interface IJavaConditionalExpression
- All Superinterfaces:
IJavaElement,IJavaExpression
Java AST interface to represent a conditional expression.
Conditional expressions in Java use the ternary operator ?:.
Example:
a ? b: c
-
Field Summary
Fields inherited from interface com.pnfsoftware.jeb.core.units.code.java.IJavaElement
FLAG_BUILT, FLAG_FIELD_REFERENCES_OUTERCLASS, FLAG_LAMBDA_CLASS, FLAG_LAMBDA_IMPL, FLAG_OPTIONAL_RENDERING, FLAG_SECOND_PARAMETER_IS_OUTER_REF, FLAG_STICKY -
Method Summary
Modifier and TypeMethodDescriptionDuplicate this element.Get the 'evaluated on false' right expression.Get the 'evaluated on true' right expression.Get the 'condition' left expression.voidSet the expression evaluated when the predicate is false.voidSet the expression evaluated when the predicate is true.voidsetPredicate(IJavaExpression pred) Set the predicate expression.Methods inherited from interface com.pnfsoftware.jeb.core.units.code.java.IJavaElement
addFlags, addTag, canCauseException, collectAllPhysicalOffsets, generate, getData, getElementType, getFlags, getOrigin, getPhysicalMethodIndex, getPhysicalOffset, getReconAnon, getReconEnum, getReconEnummap, getReconLambda, getSubElements, getTags, hasFlags, hasPhysicalMethodIndex, hasPhysicalOffset, isReconArtifact, removeFlags, removeTag, replaceSubElement, setData, setFlags, setLambdaRecon, setOrigin, setPhysicalMethodIndex, setPhysicalOffset, setReconAnon, setReconEnum, setReconEnummap, toShortString, visitDepthPost, visitDepthPost, visitDepthPost, visitDepthPost, visitDepthPre, visitDepthPre, visitDepthPre
-
Method Details
-
getPredicate
IJavaExpression getPredicate()Get the 'condition' left expression.- Returns:
- the left expression
-
setPredicate
Set the predicate expression.- Parameters:
pred- predicate expression
-
getExpressionTrue
IJavaExpression getExpressionTrue()Get the 'evaluated on true' right expression.- Returns:
- the left expression
-
setExpressionTrue
Set the expression evaluated when the predicate is true.- Parameters:
expT- true-branch expression
-
getExpressionFalse
IJavaExpression getExpressionFalse()Get the 'evaluated on false' right expression.- Returns:
- the left expression
-
setExpressionFalse
Set the expression evaluated when the predicate is false.- Parameters:
expF- false-branch expression
-
duplicate
IJavaConditionalExpression duplicate()Description copied from interface:IJavaElementDuplicate this element.- Specified by:
duplicatein interfaceIJavaElement- Specified by:
duplicatein interfaceIJavaExpression- Returns:
- a (possibly) duplicated object of the same type
-