APIdia Launch Partner
Top Description Fields Constructors Methods
com.sun.tools.javac.comp

public Class Env<A>

extends Object
implements Iterable<Env<A>>
Class Inheritance
All Implemented Interfaces
java.lang.Iterable
Known Direct Subclasses
com.sun.tools.javac.comp.AttrContextEnv
Imports
com.sun.tools.javac.tree.*, java.util.Iterator, .NoSuchElementException

A class for environments, instances of which are passed as arguments to tree visitors. Environments refer to important ancestors of the subtree that's currently visited, such as the enclosing method, the enclosing class, or the enclosing toplevel node. They also contain a generic component, represented as a type parameter, to carry further information specific to individual passes.

This is NOT part of any supported API. If you write code that depends on this, you do so at your own risk. This code and its internal interfaces are subject to change or deletion without notice.

Field Summary

Modifier and TypeField and Description
public boolean
baseClause

Is this an environment for evaluating a base clause?

public JCTree.JCClassDecl
enclClass

The next enclosing class definition.

public JCTree.JCMethodDecl
enclMethod

The next enclosing method definition.

public A
info

A generic field for further information.

public Env<A>
next

The next enclosing environment.

public Env<A>
outer

The environment enclosing the current class.

public JCTree.JCCompilationUnit
toplevel

The enclosing toplevel tree.

public JCTree
tree

The tree with which this environment is associated.

Constructor Summary

AccessConstructor and Description
public
Env(JCTree tree, A info)

Create an outermost environment for a given (toplevel)tree, with a given info field.

Method Summary

Modifier and TypeMethod and Description
public Env<A>
dup(JCTree tree, A info)

Duplicate this environment, updating with given tree and info, and copying all other fields.

public Env<A>
dup(JCTree tree)

Duplicate this environment, updating with given tree, and copying all other fields.

public Env<A>
dupto(Env<A> that)

Duplicate this environment into a given Environment, using its tree and info, and copying all other fields.

public Env<A>
enclosing(JCTree.Tag tag)

Return closest enclosing environment which points to a tree with given tag.

public Iterator<Env<A>>
iterator()

Implements java.lang.Iterable.iterator.

Returns an iterator over elements of type T.

public String
toString()

Overrides java.lang.Object.toString.

Returns a string representation of the object.

Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAllwaitwaitwait

Field Detail

baseClauseback to summary
public boolean baseClause

Is this an environment for evaluating a base clause?

enclClassback to summary
public JCTree.JCClassDecl enclClass

The next enclosing class definition.

enclMethodback to summary
public JCTree.JCMethodDecl enclMethod

The next enclosing method definition.

infoback to summary
public A info

A generic field for further information.

nextback to summary
public Env<A> next

The next enclosing environment.

outerback to summary
public Env<A> outer

The environment enclosing the current class.

toplevelback to summary
public JCTree.JCCompilationUnit toplevel

The enclosing toplevel tree.

treeback to summary
public JCTree tree

The tree with which this environment is associated.

Constructor Detail

Envback to summary
public Env(JCTree tree, A info)

Create an outermost environment for a given (toplevel)tree, with a given info field.

Method Detail

dupback to summary
public Env<A> dup(JCTree tree, A info)

Duplicate this environment, updating with given tree and info, and copying all other fields.

dupback to summary
public Env<A> dup(JCTree tree)

Duplicate this environment, updating with given tree, and copying all other fields.

duptoback to summary
public Env<A> dupto(Env<A> that)

Duplicate this environment into a given Environment, using its tree and info, and copying all other fields.

enclosingback to summary
public Env<A> enclosing(JCTree.Tag tag)

Return closest enclosing environment which points to a tree with given tag.

iteratorback to summary
public Iterator<Env<A>> iterator()

Implements java.lang.Iterable.iterator.

Doc from java.lang.Iterable.iterator.

Returns an iterator over elements of type T.

toStringback to summary
public String toString()

Overrides java.lang.Object.toString.

Doc from java.lang.Object.toString.

Returns a string representation of the object. Satisfying this method's contract implies a non-null result must be returned.

Annotations
@Override