com.sun.source.tree

## Interface Tree

All Known Subinterfaces:
  AnnotationTree, ArrayAccessTree, ArrayTypeTree, AssertTree, AssignmentTree, BinaryTree, BlockTree, BreakTree, CaseTree, CatchTree, ClassTree, CompilationUnitTree, CompoundAssignmentTree, ConditionalExpressionTree, ContinueTree, DoWhileLoopTree, EmptyStatementTree, EnhancedForLoopTree, ErroneousTree, ExpressionStatementTree, ExpressionTree, ForLoopTree, IdentifierTree, IfTree, ImportTree, InstanceOfTree, LabeledStatementTree, LiteralTree, MemberSelectTree, MethodInvocationTree, MethodTree, ModifiersTree, NewArrayTree, NewClassTree, ParameterizedTypeTree, ParenthesizedTree, PrimitiveTypeTree, ReturnTree, StatementTree, SwitchTree, SynchronizedTree, ThrowTree, TryTree, TypeCastTree, TypeParameterTree, UnaryTree, VariableTree, WhileLoopTree, WildcardTree

    public interface Tree

Common interface for all nodes in an abstract syntax tree.

WARNING: This interface and its sub-interfaces are subject to change as the Java™ programming language evolves. These interfaces are implemented by the JDK Java compiler (javac) and should not be implemented either directly or indirectly by other applications.

Since:
  1.6

### Nested Class Summary

Nested Classes
`static class` `Tree.Kind` Enumerates all kinds of trees.

### Method Summary

Methods
`<R,D> R` `accept(TreeVisitor<R,D> visitor, D data)` Accept method used to implement the visitor pattern.
`Tree.Kind` `getKind()` Gets the kind of this tree.

### Method Detail

#### getKind

    Tree.Kind getKind()

Gets the kind of this tree.

Returns:
  the kind of this tree.

#### accept

    <R,D> R accept(TreeVisitor<R,D> visitor,
                 D data)

Accept method used to implement the visitor pattern. The visitor pattern is used to implement operations on trees.

Type Parameters:
  `R` - result type of this operation.
  `D` - type of additonal data.

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