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

public abstract Class Scope

extends Object
Class Inheritance
Known Direct Subclasses
com.sun.tools.javac.code.Scope.WriteableScope, com.sun.tools.javac.code.Scope.NamedImportScope.SingleEntryScope, com.sun.tools.javac.code.Scope.FilterImportScope, com.sun.tools.javac.code.Scope.CompoundScope
Imports
com.sun.tools.javac.code.Kinds.Kind, .Symbol.CompletionFailure, .Symbol.TypeSymbol, java.lang.ref.WeakReference, java.util.*, java.util.function.BiConsumer, .Predicate, com.sun.tools.javac.tree.JCTree.JCImport, com.sun.tools.javac.util.*, .List

A scope represents an area of visibility in a Java program. The Scope class is a container for symbols which provides efficient access to symbols given their names. Scopes are implemented as hash tables with "open addressing" and "double hashing". Scopes can be nested. Nested scopes can share their hash tables.

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.

Nested and Inner Type Summary

Modifier and TypeClass and Description
public static class
Scope.CompoundScope

A class scope adds capabilities to keep track of changes in related class scopes - this allows client to realize whether a class scope has changed, either directly (because a new member has been added/removed to this scope) or indirectly (i.e. because a new member has been added/removed into a supertype scope)

private static class
Scope.Entry

A class for scope entries.

public static class
Scope.ErrorScope

An error scope, for which the owner should be an error symbol.

private static class
public static interface
public static class
public static enum
public static class
private static class
public static interface
public static class
Scope.ScopeListenerList

A list of scope listeners; listeners are stored in weak references, to avoid memory leaks.

public static class
public abstract static class
Scope.WriteableScope

A scope into which Symbols can be added.

Field Summary

Modifier and TypeField and Description
pack-priv Scope.ScopeListenerList
listeners

A list of scopes to be notified if items are to be removed from this scope.

private static final Predicate<Symbol>
public final Symbol
owner

The scope's owner.

Constructor Summary

AccessConstructor and Description
protected
Scope(Symbol owner)

Method Summary

Modifier and TypeMethod and Description
public boolean
anyMatch(Predicate<Symbol> filter)

Returns true iff there is at least one Symbol in this scope matching the given filter.

public final Symbol
findFirst(Name name)

Returns the first Symbol from this or outward scopes with the given name.

public Symbol
findFirst(Name name, Predicate<Symbol> sf)

Returns the first Symbol from this or outward scopes with the given name that matches the given filter.

public abstract Scope
getOrigin(Symbol byName)

Returns the Scope from which the given Symbol originates in this scope.

public final Iterable<Symbol>
getSymbols()

Returns all Symbols in this Scope.

public final Iterable<Symbol>
getSymbols(Predicate<Symbol> sf)

Returns Symbols that match the given filter.

public final Iterable<Symbol>
getSymbols(Scope.LookupKind lookupKind)

Returns all Symbols in this Scope.

public abstract Iterable<Symbol>
getSymbols(Predicate<Symbol> sf, Scope.LookupKind lookupKind)

Returns Symbols that match the given filter.

public final Iterable<Symbol>
getSymbolsByName(Name name)

Returns Symbols with the given name.

public final Iterable<Symbol>
getSymbolsByName(final Name name, final Predicate<Symbol> sf)

Returns Symbols with the given name that match the given filter.

public final Iterable<Symbol>
getSymbolsByName(Name name, Scope.LookupKind lookupKind)

Returns Symbols with the given name.

public abstract Iterable<Symbol>
getSymbolsByName(final Name name, final Predicate<Symbol> sf, final Scope.LookupKind lookupKind)

Returns Symbols with the given name that match the given filter.

public boolean
includes(final Symbol sym)

Returns true iff the given Symbol is in this scope or any outward scope.

public boolean
includes(final Symbol sym, Scope.LookupKind lookupKind)

Returns true iff the given Symbol is in this scope, optionally checking outward scopes.

public boolean
isEmpty()

Returns true iff this scope does not contain any Symbol.

public abstract boolean
isStaticallyImported(Symbol byName)

Returns true iff the given Symbol is part of this scope due to a static import.

Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait