YieldTree (Java SE 9 & JDK 9 )
Keywords: jdk.nashorn.api.tree.YieldTree interface

Module jdk.scripting.nashorn
Package jdk.nashorn.api.tree

## Interface YieldTree

- All Superinterfaces:
    `ExpressionTree`, `Tree`

      public interface YieldTree
      extends ExpressionTree

  A tree node for yield expressions used in generator functions. For example:

       function* id(){
           var index = 0;
           while(index < 10)
               yield index++;
       }

  Since:
    9

- - ### Nested Class Summary

    - ### Nested classes/interfaces inherited from interface jdk.nashorn.api.tree.Tree

      `Tree.Kind`

  - ### Method Summary

    All Methods Instance Methods Abstract Methods
    Modifier and Type | Method | Description
    --- | --- | ---
    `ExpressionTree` | `getExpression​()` | Returns the expression that is yielded.
    `boolean` | `isStar​()` | Is this a yield * expression in a generator function?

    - ### Methods inherited from interface jdk.nashorn.api.tree.Tree

      `accept, getEndPosition, getKind, getStartPosition`

- - ### Method Detail

    - #### getExpression

          ExpressionTree getExpression​()

      Returns the expression that is yielded.
      Returns:
        The expression that is yielded.

    - #### isStar

          boolean isStar​()

      Is this a yield * expression in a generator function? For example:

           function* id(){
               yield 1;
               yield * anotherGeneratorFunc();
               yield 10;
           }

      Returns:
        true if this is a yield * expression