com.sun.tools.javac.tree
Class JCTree.JCCompilationUnit

java.lang.Object
  extended by com.sun.tools.javac.tree.JCTree
      extended by com.sun.tools.javac.tree.JCTree.JCCompilationUnit
All Implemented Interfaces:
CompilationUnitTree, Tree, JCDiagnostic.DiagnosticPosition, java.lang.Cloneable
Enclosing class:
JCTree

public static class JCTree.JCCompilationUnit
extends JCTree
implements CompilationUnitTree

Everything in one source file is kept in a TopLevel structure.


Nested Class Summary
 
Nested classes/interfaces inherited from class com.sun.tools.javac.tree.JCTree
JCTree.Factory, JCTree.JCAnnotation, JCTree.JCArrayAccess, JCTree.JCArrayTypeTree, JCTree.JCAssert, JCTree.JCAssign, JCTree.JCAssignOp, JCTree.JCBinary, JCTree.JCBlock, JCTree.JCBracketExpr, JCTree.JCBracketStat, JCTree.JCBreak, JCTree.JCCase, JCTree.JCCatch, JCTree.JCClassDecl, JCTree.JCCompilationUnit, JCTree.JCConditional, JCTree.JCContinue, JCTree.JCDoWhileLoop, JCTree.JCEnhancedForLoop, JCTree.JCErroneous, JCTree.JCEscapeExpr, JCTree.JCEscapeStat, JCTree.JCExpression, JCTree.JCExpressionStatement, JCTree.JCFieldAccess, JCTree.JCForLoop, JCTree.JCIdent, JCTree.JCIf, JCTree.JCImport, JCTree.JCInstanceOf, JCTree.JCLabeledStatement, JCTree.JCLiteral, JCTree.JCMethodDecl, JCTree.JCMethodInvocation, JCTree.JCModifiers, JCTree.JCNewArray, JCTree.JCNewClass, JCTree.JCParens, JCTree.JCPrimitiveTypeTree, JCTree.JCReturn, JCTree.JCSkip, JCTree.JCStatement, JCTree.JCSwitch, JCTree.JCSynchronized, JCTree.JCThrow, JCTree.JCTry, JCTree.JCTypeApply, JCTree.JCTypeCast, JCTree.JCTypeParameter, JCTree.JCUnary, JCTree.JCVariableDecl, JCTree.JCWhileLoop, JCTree.JCWildcard, JCTree.LetExpr, JCTree.TypeBoundKind, JCTree.Visitor
 
Nested classes/interfaces inherited from interface com.sun.source.tree.Tree
Tree.Kind
 
Field Summary
 List<JCTree> defs
           
 java.util.Map<JCTree,java.lang.String> docComments
           
 java.util.Map<JCTree,java.lang.Integer> endPositions
           
 long flags
           
 Position.LineMap lineMap
           
 Scope namedImportScope
           
 List<JCTree.JCAnnotation> packageAnnotations
           
 Symbol.PackageSymbol packge
           
 JCTree.JCExpression pid
           
 JavaFileObject sourcefile
           
 Scope starImportScope
           
 
Fields inherited from class com.sun.tools.javac.tree.JCTree
AND, ANNOTATION, APPLY, ASGOffset, ASSERT, ASSIGN, BITAND, BITAND_ASG, BITOR, BITOR_ASG, BITXOR, BITXOR_ASG, BLOCK, BRACKET_EXPR, BRACKET_STAT, BREAK, CASE, CATCH, CLASSDEF, COMPL, CONDEXPR, CONTINUE, DIV, DIV_ASG, DOLOOP, EQ, ERRONEOUS, ESCAPE_EXPR, ESCAPE_STAT, EXEC, FOREACHLOOP, FORLOOP, GE, GT, IDENT, IF, IMPORT, INDEXED, LABELLED, LE, LETEXPR, LITERAL, LT, METHODDEF, MINUS, MINUS_ASG, MOD, MOD_ASG, MODIFIERS, MUL, MUL_ASG, NE, NEG, NEWARRAY, NEWCLASS, NOT, NULLCHK, OR, PARENS, PLUS, PLUS_ASG, pos, POS, POSTDEC, POSTINC, PREDEC, PREINC, RETURN, SELECT, SKIP, SL, SL_ASG, SR, SR_ASG, SWITCH, SYNCHRONIZED, THROW, TOPLEVEL, TRY, type, TYPEAPPLY, TYPEARRAY, TYPEBOUNDKIND, TYPECAST, TYPEIDENT, TYPEPARAMETER, TYPETEST, USR, USR_ASG, VARDEF, WHILELOOP, WILDCARD
 
Constructor Summary
protected JCTree.JCCompilationUnit(List<JCTree.JCAnnotation> packageAnnotations, JCTree.JCExpression pid, List<JCTree> defs, JavaFileObject sourcefile, Symbol.PackageSymbol packge, Scope namedImportScope, Scope starImportScope)
           
 
Method Summary
 void accept(JCTree.Visitor v)
          Visit this tree with a given visitor.
<R,D> R
accept(TreeVisitor<R,D> v, D d)
          Accept method used to implement the visitor pattern.
 List<JCTree.JCImport> getImports()
           
 Tree.Kind getKind()
          Gets the kind of this tree.
 Position.LineMap getLineMap()
          Gets the line map for this compilation unit, if available.
 List<JCTree.JCAnnotation> getPackageAnnotations()
           
 JCTree.JCExpression getPackageName()
           
 JavaFileObject getSourceFile()
           
 int getTag()
           
 List<JCTree> getTypeDecls()
           
 
Methods inherited from class com.sun.tools.javac.tree.JCTree
clone, getEndPosition, getPreferredPosition, getStartPosition, getTree, pos, setPos, setType, toString
 
Methods inherited from class java.lang.Object
equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

packageAnnotations

public List<JCTree.JCAnnotation> packageAnnotations

pid

public JCTree.JCExpression pid

defs

public List<JCTree> defs

sourcefile

public JavaFileObject sourcefile

packge

public Symbol.PackageSymbol packge

namedImportScope

public Scope namedImportScope

starImportScope

public Scope starImportScope

flags

public long flags

lineMap

public Position.LineMap lineMap

docComments

public java.util.Map<JCTree,java.lang.String> docComments

endPositions

public java.util.Map<JCTree,java.lang.Integer> endPositions
Constructor Detail

JCTree.JCCompilationUnit

protected JCTree.JCCompilationUnit(List<JCTree.JCAnnotation> packageAnnotations,
                                   JCTree.JCExpression pid,
                                   List<JCTree> defs,
                                   JavaFileObject sourcefile,
                                   Symbol.PackageSymbol packge,
                                   Scope namedImportScope,
                                   Scope starImportScope)
Method Detail

accept

public void accept(JCTree.Visitor v)
Description copied from class: JCTree
Visit this tree with a given visitor.

Specified by:
accept in class JCTree

getKind

public Tree.Kind getKind()
Description copied from interface: Tree
Gets the kind of this tree.

Specified by:
getKind in interface Tree
Returns:
the kind of this tree.

getPackageAnnotations

public List<JCTree.JCAnnotation> getPackageAnnotations()
Specified by:
getPackageAnnotations in interface CompilationUnitTree

getImports

public List<JCTree.JCImport> getImports()
Specified by:
getImports in interface CompilationUnitTree

getPackageName

public JCTree.JCExpression getPackageName()
Specified by:
getPackageName in interface CompilationUnitTree

getSourceFile

public JavaFileObject getSourceFile()
Specified by:
getSourceFile in interface CompilationUnitTree

getLineMap

public Position.LineMap getLineMap()
Description copied from interface: CompilationUnitTree
Gets the line map for this compilation unit, if available. Returns null if the line map is not available.

Specified by:
getLineMap in interface CompilationUnitTree
Returns:
the line map for this compilation unit

getTypeDecls

public List<JCTree> getTypeDecls()
Specified by:
getTypeDecls in interface CompilationUnitTree

accept

public <R,D> R accept(TreeVisitor<R,D> v,
                      D d)
Description copied from interface: Tree
Accept method used to implement the visitor pattern. The visitor pattern is used to implement operations on trees.

Specified by:
accept in interface Tree
Specified by:
accept in class JCTree
Type Parameters:
R - result type of this operation.
D - type of additonal data.

getTag

public int getTag()
Specified by:
getTag in class JCTree