src/jdk.scripting.nashorn/share/classes/jdk/nashorn/api/tree/IfTree.java

Print this page




  24  */
  25 
  26 package jdk.nashorn.api.tree;
  27 
  28 /**
  29  * A tree node for an 'if' statement.
  30  *
  31  * For example:
  32  * <pre>
  33  *   if ( <em>condition</em> )
  34  *      <em>thenStatement</em>
  35  *
  36  *   if ( <em>condition</em> )
  37  *       <em>thenStatement</em>
  38  *   else
  39  *       <em>elseStatement</em>
  40  * </pre>
  41  *
  42  * @since 1.9
  43  */
  44 @jdk.Exported
  45 public interface IfTree extends StatementTree {
  46     /**
  47      * Returns the condition expression of this 'if' statement.
  48      *
  49      * @return the condition expression
  50      */
  51     ExpressionTree getCondition();
  52 
  53     /**
  54      * Returns the 'then' statement of this 'if' statement.
  55      *
  56      * @return the 'then' statement
  57      */
  58     StatementTree getThenStatement();
  59 
  60     /**
  61      * Returns the then statement of this 'if' statement.
  62      * null if this if statement has no else branch.
  63      *
  64      * @return the 'else' statement


  24  */
  25 
  26 package jdk.nashorn.api.tree;
  27 
  28 /**
  29  * A tree node for an 'if' statement.
  30  *
  31  * For example:
  32  * <pre>
  33  *   if ( <em>condition</em> )
  34  *      <em>thenStatement</em>
  35  *
  36  *   if ( <em>condition</em> )
  37  *       <em>thenStatement</em>
  38  *   else
  39  *       <em>elseStatement</em>
  40  * </pre>
  41  *
  42  * @since 1.9
  43  */

  44 public interface IfTree extends StatementTree {
  45     /**
  46      * Returns the condition expression of this 'if' statement.
  47      *
  48      * @return the condition expression
  49      */
  50     ExpressionTree getCondition();
  51 
  52     /**
  53      * Returns the 'then' statement of this 'if' statement.
  54      *
  55      * @return the 'then' statement
  56      */
  57     StatementTree getThenStatement();
  58 
  59     /**
  60      * Returns the then statement of this 'if' statement.
  61      * null if this if statement has no else branch.
  62      *
  63      * @return the 'else' statement