Package Summary Overview Summary

### class:TreeScanner [CHANGED]
Type Parameters: `R` - the return type of this visitor's methods. Use `Void` for visitors that do not need to return results. `P` - the type of the additional parameter to this visitor's methods. Use `Void` for visitors that do not need an additional parameter. All Implemented Interfaces: `TreeVisitor<R,P>` Direct Known Subclasses: `TreePathScanner` public class TreeScanner<R,P>extends Object implements TreeVisitor<R,P> `TreeScanner` relies on preview features of the Java platform: `TreeScanner` refers to one or more preview APIs: `AnyPatternTree`. Programs can only use `TreeScanner` when preview features are enabled. Preview features may be removed in a future release, or upgraded to permanent features of the Java platform. A TreeVisitor that visits all the child tree nodes. To visit nodes of a particular type, just override the corresponding visitXYZ method. Inside your method, call super.visitXYZ to visit descendant nodes. Here is an example to count the number of identifier nodes in a tree:
       class CountIdentifiers extends TreeScanner<Integer,Void> {
          @Override
          public Integer visitIdentifier(IdentifierTree node, Void p) {
              return 1;
          }
          @Override
          public Integer reduce(Integer r1, Integer r2) {
              return (r1 == null ? 0 : r1) + (r2 == null ? 0 : r2);
          }
       }
Implementation Requirements: The default implementation of the visitXYZ methods will determine a result as follows: If the node being visited has no children, the result will be `null`. If the node being visited has one child, the result will be the result of calling `scan` with that child. The child may be a simple node or itself a list of nodes. If the node being visited has more than one child, the result will be determined by calling `scan` with each child in turn, and then combining the result of each scan after the first with the cumulative result so far, as determined by the `reduce(R, R)` method. Each child may be either a simple node or a list of nodes. The default behavior of the `reduce` method is such that the result of the visitXYZ method will be the result of the last child scanned. Since: 1.6
Type Parameters: `R` - the return type of this visitor's methods. Use `Void` for visitors that do not need to return results. `P` - the type of the additional parameter to this visitor's methods. Use `Void` for visitors that do not need an additional parameter. All Implemented Interfaces: `TreeVisitor<R,P>` Direct Known Subclasses: `TreePathScanner` public class TreeScanner<R,P>extends Object implements TreeVisitor<R,P> `TreeScanner` relies on preview features of the Java platform: `TreeScanner` refers to one or more preview APIs: `AnyPatternTree`. Programs can only use `TreeScanner` when preview features are enabled. Preview features may be removed in a future release, or upgraded to permanent features of the Java platform. A TreeVisitor that visits all the child tree nodes. To visit nodes of a particular type, just override the corresponding visitXYZ method. Inside your method, call super.visitXYZ to visit descendant nodes. Here is an example to count the number of identifier nodes in a tree:
       class CountIdentifiers extends TreeScanner<Integer,Void> {
          @Override
          public Integer visitIdentifier(IdentifierTree node, Void p) {
              return 1;
          }
          @Override
          public Integer reduce(Integer r1, Integer r2) {
              return (r1 == null ? 0 : r1) + (r2 == null ? 0 : r2);
          }
       }
Implementation Requirements: The default implementation of the visitXYZ methods will determine a result as follows: If the node being visited has no children, the result will be `null`. If the node being visited has one child, the result will be the result of calling `scan` with that child. The child may be a simple node or itself a list of nodes. If the node being visited has more than one child, the result will be determined by calling `scan` with each child in turn, and then combining the result of each scan after the first with the cumulative result so far, as determined by the `reduce(R, R)` method. Each child may be either a simple node or a list of nodes. The default behavior of the `reduce` method is such that the result of the visitXYZ method will be the result of the last child scanned. Since: 1.6 | Type Parameters: `R` - the return type of this visitor's methods. Use `Void` for visitors that do not need to return results. `P` - the type of the additional parameter to this visitor's methods. Use `Void` for visitors that do not need an additional parameter. All Implemented Interfaces: `TreeVisitor<R,P>` Direct Known Subclasses: `TreePathScanner` public class TreeScanner<R,P>extends Object implements TreeVisitor<R,P> A TreeVisitor that visits all the child tree nodes. To visit nodes of a particular type, just override the corresponding visitXYZ method. Inside your method, call super.visitXYZ to visit descendant nodes. Here is an example to count the number of identifier nodes in a tree:
       class CountIdentifiers extends TreeScanner<Integer,Void> {
          @Override
          public Integer visitIdentifier(IdentifierTree node, Void p) {
              return 1;
          }
          @Override
          public Integer reduce(Integer r1, Integer r2) {
              return (r1 == null ? 0 : r1) + (r2 == null ? 0 : r2);
          }
       }
Implementation Requirements: The default implementation of the visitXYZ methods will determine a result as follows: If the node being visited has no children, the result will be `null`. If the node being visited has one child, the result will be the result of calling `scan` with that child. The child may be a simple node or itself a list of nodes. If the node being visited has more than one child, the result will be determined by calling `scan` with each child in turn, and then combining the result of each scan after the first with the cumulative result so far, as determined by the `reduce(R, R)` method. Each child may be either a simple node or a list of nodes. The default behavior of the `reduce` method is such that the result of the visitXYZ method will be the result of the last child scanned. Since: 1.6

### method:visitAnyPattern(com.sun.source.tree.AnyPatternTree,P) [CHANGED]
### visitAnyPattern public R visitAnyPattern (AnyPatternTreePREVIEW node, P p) Visits a `AnyPatternTree` node. Specified by: `visitAnyPattern` in interface `TreeVisitor<R, P>` Implementation Requirements: This implementation returns `null`. Parameters: `node` - the node being visited `p` - a parameter value Returns: the result of scanning Since: 21
### visitAnyPattern public R visitAnyPattern (AnyPatternTreePREVIEW node, P p) Visits a `AnyPatternTree` node. Specified by: `visitAnyPattern` in interface `TreeVisitor<R, P>` Implementation Requirements: This implementation returns `null`. Parameters: `node` - the node being visited `p` - a parameter value Returns: the result of scanning Since: 21 | ### visitAnyPattern public R visitAnyPattern (AnyPatternTree node, P p) Visits a `AnyPatternTree` node. Specified by: `visitAnyPattern` in interface `TreeVisitor<R, P>` Implementation Requirements: This implementation returns `null`. Parameters: `node` - the node being visited `p` - a parameter value Returns: the result of scanning Since: 21