com.sun.source.tree

## Interface IfTree

- All Superinterfaces:
    StatementTree, Tree

      public interface IfTree
      extends StatementTree

  A tree node for an 'if' statement. For example:

         if ( condition )
            thenStatement

         if ( condition )
             thenStatement
         else
             elseStatement

  Since:
    1.6
  See The Java™ Language Specification:
    section 14.9

- - ### Nested Class Summary

    - ### Nested classes/interfaces inherited from interface com.sun.source.tree.Tree

      `Tree.Kind`

  - ### Method Summary

    Methods
    Modifier and Type | Method and Description
    --- | ---
    `ExpressionTree` | `getCondition()`
    `StatementTree` | `getElseStatement()`
    `StatementTree` | `getThenStatement()`

    - ### Methods inherited from interface com.sun.source.tree.Tree

      `accept, getKind`

- - ### Method Detail

    - #### getCondition

          ExpressionTree getCondition()

    - #### getThenStatement

          StatementTree getThenStatement()

    - #### getElseStatement

          StatementTree getElseStatement()

      Returns:
        null if this if statement has no else branch.

Copyright © 2005, 2019, Oracle and/or its affiliates. All rights reserved.