org.jetbrains.jet.lang.resolve.scopes
Class WritableScopeImpl

java.lang.Object
  extended by org.jetbrains.jet.lang.resolve.scopes.AbstractScopeAdapter
      extended by org.jetbrains.jet.lang.resolve.scopes.JetScopeAdapter
          extended by org.jetbrains.jet.lang.resolve.scopes.WritableScopeWithImports
              extended by org.jetbrains.jet.lang.resolve.scopes.WritableScopeImpl
All Implemented Interfaces:
JetScope, WritableScope

public class WritableScopeImpl
extends WritableScopeWithImports


Nested Class Summary
 
Nested classes/interfaces inherited from interface org.jetbrains.jet.lang.resolve.scopes.WritableScope
WritableScope.LockLevel
 
Field Summary
 
Fields inherited from class org.jetbrains.jet.lang.resolve.scopes.WritableScopeWithImports
redeclarationHandler
 
Fields inherited from interface org.jetbrains.jet.lang.resolve.scopes.JetScope
EMPTY
 
Constructor Summary
WritableScopeImpl(JetScope scope, DeclarationDescriptor owner, RedeclarationHandler redeclarationHandler, java.lang.String debugName)
           
 
Method Summary
 void addClassifierAlias(Name name, ClassifierDescriptor classifierDescriptor)
           
 void addClassifierDescriptor(ClassifierDescriptor classDescriptor)
           
 void addFunctionAlias(Name name, FunctionDescriptor functionDescriptor)
           
 void addFunctionDescriptor(FunctionDescriptor functionDescriptor)
           
 void addLabeledDeclaration(DeclarationDescriptor descriptor)
           
 void addNamespace(NamespaceDescriptor namespaceDescriptor)
           
 void addNamespaceAlias(Name name, NamespaceDescriptor namespaceDescriptor)
           
 void addObjectDescriptor(ClassDescriptor objectDescriptor)
           
 void addPropertyDescriptor(VariableDescriptor propertyDescriptor)
           
 void addTypeParameterDescriptor(TypeParameterDescriptor typeParameterDescriptor)
           
 void addVariableAlias(Name name, VariableDescriptor variableDescriptor)
           
 void addVariableDescriptor(VariableDescriptor variableDescriptor)
           
 void clearImports()
           
protected  java.util.List<ReceiverParameterDescriptor> computeImplicitReceiversHierarchy()
           
 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)
           
 com.google.common.collect.Multimap<Name,DeclarationDescriptor> getDeclaredDescriptorsAccessibleBySimpleName()
           
 NamespaceDescriptor getDeclaredNamespace(Name name)
           
 java.util.List<VariableDescriptor> getDeclaredVariables()
           
 java.util.Collection<FunctionDescriptor> getFunctions(Name name)
           
 VariableDescriptor getLocalVariable(Name name)
           
 NamespaceDescriptor getNamespace(Name name)
           
 ClassDescriptor getObjectDescriptor(Name name)
           
 java.util.Set<ClassDescriptor> getObjectDescriptors()
           
 java.util.Collection<DeclarationDescriptor> getOwnDeclaredDescriptors()
           
 java.util.Set<VariableDescriptor> getProperties(Name name)
           
 PropertyDescriptor getPropertyByFieldReference(Name fieldName)
           
 boolean hasDeclaredItems()
           
 void importClassifierAlias(Name importedClassifierName, ClassifierDescriptor classifierDescriptor)
           
 void importFunctionAlias(Name aliasName, FunctionDescriptor functionDescriptor)
           
 void importNamespaceAlias(Name aliasName, NamespaceDescriptor namespaceDescriptor)
           
 void importScope(JetScope imported)
           
 void importVariableAlias(Name aliasName, VariableDescriptor variableDescriptor)
           
 void setImplicitReceiver(ReceiverParameterDescriptor implicitReceiver)
           
 
Methods inherited from class org.jetbrains.jet.lang.resolve.scopes.WritableScopeWithImports
changeLockLevel, checkMayNotWrite, checkMayRead, checkMayWrite, getImplicitReceiversHierarchy, getImports, toString
 
Methods inherited from class org.jetbrains.jet.lang.resolve.scopes.JetScopeAdapter
getWorkerScope
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

WritableScopeImpl

public WritableScopeImpl(@NotNull
                         JetScope scope,
                         @NotNull
                         DeclarationDescriptor owner,
                         @NotNull
                         RedeclarationHandler redeclarationHandler,
                         @NotNull
                         java.lang.String debugName)
Method Detail

getContainingDeclaration

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

importScope

public void importScope(@NotNull
                        JetScope imported)
Specified by:
importScope in interface WritableScope
Overrides:
importScope in class WritableScopeWithImports

importClassifierAlias

public void importClassifierAlias(@NotNull
                                  Name importedClassifierName,
                                  @NotNull
                                  ClassifierDescriptor classifierDescriptor)
Specified by:
importClassifierAlias in interface WritableScope
Overrides:
importClassifierAlias in class WritableScopeWithImports

importNamespaceAlias

public void importNamespaceAlias(@NotNull
                                 Name aliasName,
                                 @NotNull
                                 NamespaceDescriptor namespaceDescriptor)
Specified by:
importNamespaceAlias in interface WritableScope
Overrides:
importNamespaceAlias in class WritableScopeWithImports

importFunctionAlias

public void importFunctionAlias(@NotNull
                                Name aliasName,
                                @NotNull
                                FunctionDescriptor functionDescriptor)
Specified by:
importFunctionAlias in interface WritableScope
Overrides:
importFunctionAlias in class WritableScopeWithImports

importVariableAlias

public void importVariableAlias(@NotNull
                                Name aliasName,
                                @NotNull
                                VariableDescriptor variableDescriptor)
Specified by:
importVariableAlias in interface WritableScope
Overrides:
importVariableAlias in class WritableScopeWithImports

clearImports

public void clearImports()
Specified by:
clearImports in interface WritableScope
Overrides:
clearImports in class WritableScopeWithImports

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
Overrides:
getAllDescriptors in class AbstractScopeAdapter
Returns:
All visible descriptors from current scope.

getDeclarationsByLabel

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

addLabeledDeclaration

public void addLabeledDeclaration(@NotNull
                                  DeclarationDescriptor descriptor)

addVariableDescriptor

public void addVariableDescriptor(@NotNull
                                  VariableDescriptor variableDescriptor)

addPropertyDescriptor

public void addPropertyDescriptor(@NotNull
                                  VariableDescriptor propertyDescriptor)

getProperties

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

getLocalVariable

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

addFunctionDescriptor

public void addFunctionDescriptor(@NotNull
                                  FunctionDescriptor functionDescriptor)

getFunctions

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

addTypeParameterDescriptor

public void addTypeParameterDescriptor(@NotNull
                                       TypeParameterDescriptor typeParameterDescriptor)

addClassifierDescriptor

public void addClassifierDescriptor(@NotNull
                                    ClassifierDescriptor classDescriptor)

addObjectDescriptor

public void addObjectDescriptor(@NotNull
                                ClassDescriptor objectDescriptor)

addClassifierAlias

public void addClassifierAlias(@NotNull
                               Name name,
                               @NotNull
                               ClassifierDescriptor classifierDescriptor)

addNamespaceAlias

public void addNamespaceAlias(@NotNull
                              Name name,
                              @NotNull
                              NamespaceDescriptor namespaceDescriptor)

addFunctionAlias

public void addFunctionAlias(@NotNull
                             Name name,
                             @NotNull
                             FunctionDescriptor functionDescriptor)

addVariableAlias

public void addVariableAlias(@NotNull
                             Name name,
                             @NotNull
                             VariableDescriptor variableDescriptor)

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
Overrides:
getClassifier in class WritableScopeWithImports

getObjectDescriptor

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

getObjectDescriptors

@NotNull
public java.util.Set<ClassDescriptor> getObjectDescriptors()
Specified by:
getObjectDescriptors in interface JetScope
Overrides:
getObjectDescriptors in class AbstractScopeAdapter

addNamespace

public void addNamespace(@NotNull
                         NamespaceDescriptor namespaceDescriptor)

getDeclaredNamespace

public NamespaceDescriptor getDeclaredNamespace(@NotNull
                                                Name name)

getNamespace

public NamespaceDescriptor getNamespace(@NotNull
                                        Name name)
Specified by:
getNamespace in interface JetScope
Overrides:
getNamespace in class WritableScopeWithImports

setImplicitReceiver

public void setImplicitReceiver(@NotNull
                                ReceiverParameterDescriptor implicitReceiver)

computeImplicitReceiversHierarchy

protected java.util.List<ReceiverParameterDescriptor> computeImplicitReceiversHierarchy()
Overrides:
computeImplicitReceiversHierarchy in class WritableScopeWithImports

getPropertyByFieldReference

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

getDeclaredVariables

public java.util.List<VariableDescriptor> getDeclaredVariables()

hasDeclaredItems

public boolean hasDeclaredItems()

getDeclaredDescriptorsAccessibleBySimpleName

@NotNull
public com.google.common.collect.Multimap<Name,DeclarationDescriptor> getDeclaredDescriptorsAccessibleBySimpleName()

getOwnDeclaredDescriptors

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