Package com.google.turbine.binder.lookup
Class ImportIndex
- java.lang.Object
-
- com.google.turbine.binder.lookup.ImportIndex
-
- All Implemented Interfaces:
ImportScope
public class ImportIndex extends java.lang.Object implements ImportScope
A scope that provides entries for the single-type imports in a compilation unit.Import resolution is lazy; imports are not evaluated until the first request for a matching simple name.
Static imports of types, and on-demand imports of types (static or otherwise), are not supported.
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from interface com.google.turbine.binder.lookup.ImportScope
ImportScope.ResolveFunction
-
-
Constructor Summary
Constructors Constructor Description ImportIndex(TurbineLog.TurbineLogWithSource log, com.google.common.collect.ImmutableMap<java.lang.String,com.google.common.base.Supplier<ImportScope>> thunks)
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description static ImportIndexcreate(TurbineLog.TurbineLogWithSource log, CanonicalSymbolResolver resolve, TopLevelIndex cpi, com.google.common.collect.ImmutableList<Tree.ImportDecl> imports)Creates an import index for the given top-level environment.@Nullable LookupResultlookup(LookupKey lookup, ImportScope.ResolveFunction resolve)-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface com.google.turbine.binder.lookup.ImportScope
append, toScope
-
-
-
-
Constructor Detail
-
ImportIndex
public ImportIndex(TurbineLog.TurbineLogWithSource log, com.google.common.collect.ImmutableMap<java.lang.String,com.google.common.base.Supplier<ImportScope>> thunks)
-
-
Method Detail
-
create
public static ImportIndex create(TurbineLog.TurbineLogWithSource log, CanonicalSymbolResolver resolve, TopLevelIndex cpi, com.google.common.collect.ImmutableList<Tree.ImportDecl> imports)
Creates an import index for the given top-level environment.
-
lookup
public @Nullable LookupResult lookup(LookupKey lookup, ImportScope.ResolveFunction resolve)
Description copied from interface:ImportScope- Specified by:
lookupin interfaceImportScope
-
-