モジュール jdk.scripting.nashorn
パッケージ jdk.nashorn.api.tree

インタフェースIfTree

  • すべてのスーパー・インタフェース:
    StatementTree, Tree


    public interface IfTree
    extends StatementTree
    「if」文のツリー・ノードです。 たとえば、
       if ( condition )
          thenStatement
    
       if ( condition )
           thenStatement
       else
           elseStatement
     
    導入されたバージョン:
    9
    • メソッドの詳細

      • getCondition

        ExpressionTree getCondition​()
        この'if'文の条件式を返します。
        戻り値:
        条件式
      • getThenStatement

        StatementTree getThenStatement​()
        この'if'文の'then'文を返します。
        戻り値:
        'then'文
      • getElseStatement

        StatementTree getElseStatement​()
        この'if'文のthen文を返します。このif文にelseブランチがない場合はnull。
        戻り値:
        'else'文