< prev index next >

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

Print this page

      22  * or visit www.oracle.com if you need additional information or have any
      23  * questions.
      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 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
      22  * or visit www.oracle.com if you need additional information or have any
      23  * questions.
      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  * @deprecated Nashorn JavaScript script engine and APIs, and the jjs tool
      43  * are deprecated with the intent to remove them in a future release.
      44  *
      45  * @since 9
      46  */
      47 @Deprecated(since="11", forRemoval=true)
      48 public interface IfTree extends StatementTree {
      49     /**
      50      * Returns the condition expression of this 'if' statement.
      51      *
      52      * @return the condition expression
      53      */
      54     ExpressionTree getCondition();
      55
      56     /**
      57      * Returns the 'then' statement of this 'if' statement.
      58      *
      59      * @return the 'then' statement
      60      */
      61     StatementTree getThenStatement();
      62
      63     /**
      64      * Returns the then statement of this 'if' statement.
      65      * null if this if statement has no else branch.
      66      *
      67      * @return the 'else' statement

< prev index next >