Package org.jruby.ast

Class IfNode

java.lang.Object
org.jruby.ast.Node
org.jruby.ast.IfNode

public class IfNode extends Node
an 'if' statement.
  • Constructor Details

    • IfNode

      public IfNode(int line, Node condition, Node thenBody, Node elseBody)
  • Method Details

    • getNodeType

      public NodeType getNodeType()
      Specified by:
      getNodeType in class Node
      Returns:
      the nodeId
    • accept

      public <T> T accept(NodeVisitor<T> iVisitor)
      Accept for the visitor pattern.
      Specified by:
      accept in class Node
      Parameters:
      iVisitor - the visitor
    • getCondition

      public Node getCondition()
      Gets the condition.
      Returns:
      Returns a Node
    • getElseBody

      public Node getElseBody()
      Gets the elseBody.
      Returns:
      Returns a Node
    • getThenBody

      public Node getThenBody()
      Gets the thenBody.
      Returns:
      Returns a Node
    • childNodes

      public List<Node> childNodes()
      Specified by:
      childNodes in class Node