Package icyllis.arc3d.compiler.tree

# Class ConditionalExpression

java.lang.Object
icyllis.arc3d.compiler.tree.Node
icyllis.arc3d.compiler.tree.Expression
icyllis.arc3d.compiler.tree.ConditionalExpression

public final class ConditionalExpression extends Expression
A conditional expression (condition ? true-expression : false-expression).

- ## Nested Class Summary

  ## Nested classes/interfaces inherited from class icyllis.arc3d.compiler.tree.Node

  `Node.ElementKind, Node.ExpressionKind, Node.StatementKind, Node.SymbolKind`

- ## Field Summary

  ### Fields inherited from class icyllis.arc3d.compiler.tree.Node

  `mPosition`

- ## Method Summary

  Modifier and Type
  Method
  Description
  `boolean`
  `accept(TreeVisitor visitor)`
  Visit this AST with a given visitor.
  `Expression`
  `clone(int position)`
  `static Expression`
  `convert(Context context, int position, Expression condition, Expression whenTrue, Expression whenFalse)`
  `Expression`
  `getCondition()`
  `Node.ExpressionKind`
  `getKind()`
  `Expression`
  `getWhenFalse()`
  `Expression`
  `getWhenTrue()`
  `void`
  `setCondition(Expression condition)`
  `void`
  `setWhenFalse(Expression whenFalse)`
  `void`
  `setWhenTrue(Expression whenTrue)`
  `String`
  `toString(int parentPrecedence)`

  ### Methods inherited from class icyllis.arc3d.compiler.tree.Expression

  `clone, getCoercionCost, getConstantValue, getType, isBooleanLiteral, isConstructorCall, isFloatLiteral, isIncomplete, isIntLiteral, isLiteral, toString`

  ### Methods inherited from class icyllis.arc3d.compiler.tree.Node

  `getEndOffset, getStartOffset`

  ### Methods inherited from class java.lang.Object

  `equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait`

- ## Method Details

  - ### convert

    @Nullable public static Expression convert(@Nonnull Context context, int position, Expression condition, Expression whenTrue, Expression whenFalse)

  - ### getKind

    public Node.ExpressionKind getKind()
    Specified by:
      `getKind` in class `Expression`
    See Also:
      - `Node.ExpressionKind`

  - ### accept

    public boolean accept(@Nonnull TreeVisitor visitor)
    Description copied from class: `Node`
    Visit this AST with a given visitor.
    Specified by:
      `accept` in class `Node`
    Returns:
      true to stop recursion and propagate true up the stack, false to continue

  - ### getCondition

    public Expression getCondition()

  - ### setCondition

    public void setCondition(Expression condition)

  - ### getWhenTrue

    public Expression getWhenTrue()

  - ### setWhenTrue

    public void setWhenTrue(Expression whenTrue)

  - ### getWhenFalse

    public Expression getWhenFalse()

  - ### setWhenFalse

    public void setWhenFalse(Expression whenFalse)

  - ### clone

    @Nonnull public Expression clone(int position)
    Specified by:
      `clone` in class `Expression`

  - ### toString

    @Nonnull public String toString(int parentPrecedence)
    Specified by:
      `toString` in class `Expression`