org.jetbrains.jet.lang.resolve.lazy.descriptors
Class AbstractLazyMemberScope<D extends DeclarationDescriptor,DP extends DeclarationProvider>

java.lang.Object
  extended by org.jetbrains.jet.lang.resolve.lazy.descriptors.AbstractLazyMemberScope<D,DP>
All Implemented Interfaces:
JetScope
Direct Known Subclasses:
LazyClassMemberScope, LazyPackageMemberScope

public abstract class AbstractLazyMemberScope<D extends DeclarationDescriptor,DP extends DeclarationProvider>
extends java.lang.Object
implements JetScope


Field Summary
protected  DP declarationProvider
           
protected  ResolveSession resolveSession
           
protected  D thisDescriptor
           
 
Fields inherited from interface org.jetbrains.jet.lang.resolve.scopes.JetScope
EMPTY
 
Constructor Summary
protected AbstractLazyMemberScope(ResolveSession resolveSession, DP declarationProvider, D thisDescriptor)
           
 
Method Summary
protected abstract  void addExtraDescriptors(java.util.Collection<DeclarationDescriptor> result)
           
 java.util.Set<VariableDescriptor> doGetProperties(Name name)
           
 java.util.Collection<DeclarationDescriptor> getAllDescriptors()
          All visible descriptors from current scope.
 ClassifierDescriptor getClassifier(Name name)
          Should not return object (class object or enum entry) class descriptors.
 DeclarationDescriptor getContainingDeclaration()
           
 java.util.Collection<DeclarationDescriptor> getDeclarationsByLabel(LabelName labelName)
           
 java.util.Set<FunctionDescriptor> getFunctions(Name name)
           
protected abstract  ReceiverParameterDescriptor getImplicitReceiver()
           
 java.util.List<ReceiverParameterDescriptor> getImplicitReceiversHierarchy()
          Adds receivers to the list in order of locality, so that the closest (the most local) receiver goes first
 VariableDescriptor getLocalVariable(Name name)
           
protected abstract  void getNonDeclaredFunctions(Name name, java.util.Set<FunctionDescriptor> result)
           
protected abstract  void getNonDeclaredProperties(Name name, java.util.Set<VariableDescriptor> result)
           
 ClassDescriptor getObjectDescriptor(Name name)
           
 java.util.Collection<ClassDescriptor> getObjectDescriptors()
           
 java.util.Collection<DeclarationDescriptor> getOwnDeclaredDescriptors()
           
 java.util.Set<VariableDescriptor> getProperties(Name name)
           
 PropertyDescriptor getPropertyByFieldReference(Name fieldName)
           
protected abstract  JetScope getScopeForMemberDeclarationResolution(JetDeclaration declaration)
           
abstract  java.lang.String toString()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface org.jetbrains.jet.lang.resolve.scopes.JetScope
getNamespace
 

Field Detail

resolveSession

protected final ResolveSession resolveSession

declarationProvider

protected final DP extends DeclarationProvider declarationProvider

thisDescriptor

protected final D extends DeclarationDescriptor thisDescriptor
Constructor Detail

AbstractLazyMemberScope

protected AbstractLazyMemberScope(@NotNull
                                  ResolveSession resolveSession,
                                  @NotNull
                                  DP declarationProvider,
                                  @NotNull
                                  D thisDescriptor)
Method Detail

getClassifier

public ClassifierDescriptor getClassifier(@NotNull
                                          Name name)
Description copied from interface: JetScope
Should not return object (class object or enum entry) class descriptors.

Specified by:
getClassifier in interface JetScope

getObjectDescriptor

public ClassDescriptor getObjectDescriptor(@NotNull
                                           Name name)
Specified by:
getObjectDescriptor in interface JetScope

getFunctions

@NotNull
public java.util.Set<FunctionDescriptor> getFunctions(@NotNull
                                                              Name name)
Specified by:
getFunctions in interface JetScope

getScopeForMemberDeclarationResolution

@NotNull
protected abstract JetScope getScopeForMemberDeclarationResolution(JetDeclaration declaration)

getNonDeclaredFunctions

protected abstract void getNonDeclaredFunctions(@NotNull
                                                Name name,
                                                @NotNull
                                                java.util.Set<FunctionDescriptor> result)

getProperties

@NotNull
public java.util.Set<VariableDescriptor> getProperties(@NotNull
                                                               Name name)
Specified by:
getProperties in interface JetScope

doGetProperties

@NotNull
public java.util.Set<VariableDescriptor> doGetProperties(@NotNull
                                                                 Name name)

getNonDeclaredProperties

protected abstract void getNonDeclaredProperties(@NotNull
                                                 Name name,
                                                 @NotNull
                                                 java.util.Set<VariableDescriptor> result)

getObjectDescriptors

@NotNull
public java.util.Collection<ClassDescriptor> getObjectDescriptors()
Specified by:
getObjectDescriptors in interface JetScope

getLocalVariable

public VariableDescriptor getLocalVariable(@NotNull
                                           Name name)
Specified by:
getLocalVariable in interface JetScope

getContainingDeclaration

@NotNull
public DeclarationDescriptor getContainingDeclaration()
Specified by:
getContainingDeclaration in interface JetScope

getDeclarationsByLabel

@NotNull
public java.util.Collection<DeclarationDescriptor> getDeclarationsByLabel(@NotNull
                                                                                  LabelName labelName)
Specified by:
getDeclarationsByLabel in interface JetScope

getPropertyByFieldReference

public PropertyDescriptor getPropertyByFieldReference(@NotNull
                                                      Name fieldName)
Specified by:
getPropertyByFieldReference in interface JetScope
Parameters:
fieldName - includes the "$"
Returns:
the property declaring this field, if any

getAllDescriptors

@NotNull
public java.util.Collection<DeclarationDescriptor> getAllDescriptors()
Description copied from interface: JetScope
All visible descriptors from current scope.

Specified by:
getAllDescriptors in interface JetScope
Returns:
All visible descriptors from current scope.

addExtraDescriptors

protected abstract void addExtraDescriptors(@NotNull
                                            java.util.Collection<DeclarationDescriptor> result)

getImplicitReceiversHierarchy

@NotNull
public java.util.List<ReceiverParameterDescriptor> getImplicitReceiversHierarchy()
Description copied from interface: JetScope
Adds receivers to the list in order of locality, so that the closest (the most local) receiver goes first

Specified by:
getImplicitReceiversHierarchy in interface JetScope

getImplicitReceiver

@Nullable
protected abstract ReceiverParameterDescriptor getImplicitReceiver()

toString

public abstract java.lang.String toString()
Overrides:
toString in class java.lang.Object

getOwnDeclaredDescriptors

@NotNull
public java.util.Collection<DeclarationDescriptor> getOwnDeclaredDescriptors()
Specified by:
getOwnDeclaredDescriptors in interface JetScope