edu.rice.cs.dynamicjava.interpreter
Class ClassSignatureContext

java.lang.Object
  extended by edu.rice.cs.dynamicjava.interpreter.DelegatingContext
      extended by edu.rice.cs.dynamicjava.interpreter.ClassSignatureContext
All Implemented Interfaces:
TypeContext

public class ClassSignatureContext
extends DelegatingContext

The context of a class declaration's signature, which includes its type variables and own name but excludes its members.


Constructor Summary
ClassSignatureContext(TypeContext next, DJClass c, ClassLoader loader)
           
 
Method Summary
 Access.Module accessModule()
          Get the current access module.
protected  ClassSignatureContext duplicate(TypeContext next)
          Create a copy of this context with the given context enclosing it.
 ClassLoader getClassLoader()
          Return the class loader for the current scope.
 DJClass getTopLevelClass(String name, TypeSystem ts)
          Return the top-level class with the given name, or null if it does not exist.
 VariableType getTypeVariable(String name, TypeSystem ts)
          Return the type variable with the given name, or null if it does not exist.
 boolean memberClassExists(String name, TypeSystem ts)
          Test whether name is an in-scope member class
 boolean topLevelClassExists(String name, TypeSystem ts)
          Test whether name is an in-scope top-level class
 ClassType typeContainingMemberClass(String name, TypeSystem ts)
          Return the most inner type containing a class with the given name, or null if there is no such type.
 boolean typeExists(String name, TypeSystem ts)
          Test whether name is an in-scope top-level class, member class, or type variable
 boolean typeVariableExists(String name, TypeSystem ts)
          Test whether name is an in-scope type variable.
 
Methods inherited from class edu.rice.cs.dynamicjava.interpreter.DelegatingContext
fieldExists, functionExists, getDeclaredThrownTypes, getLocalFunctions, getLocalFunctions, getLocalVariable, getReturnType, getThis, getThis, getThis, importField, importMemberClass, importMemberClasses, importMethod, importStaticMembers, importTopLevelClass, importTopLevelClasses, initializingClass, localFunctionExists, localVariableExists, makeAnonymousClassName, makeClassName, methodExists, setPackage, typeContainingField, typeContainingMethod, variableExists
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ClassSignatureContext

public ClassSignatureContext(TypeContext next,
                             DJClass c,
                             ClassLoader loader)
Method Detail

duplicate

protected ClassSignatureContext duplicate(TypeContext next)
Description copied from class: DelegatingContext
Create a copy of this context with the given context enclosing it.

Specified by:
duplicate in class DelegatingContext

typeExists

public boolean typeExists(String name,
                          TypeSystem ts)
Test whether name is an in-scope top-level class, member class, or type variable

Specified by:
typeExists in interface TypeContext
Overrides:
typeExists in class DelegatingContext

topLevelClassExists

public boolean topLevelClassExists(String name,
                                   TypeSystem ts)
Test whether name is an in-scope top-level class

Specified by:
topLevelClassExists in interface TypeContext
Overrides:
topLevelClassExists in class DelegatingContext

getTopLevelClass

public DJClass getTopLevelClass(String name,
                                TypeSystem ts)
                         throws AmbiguousNameException
Return the top-level class with the given name, or null if it does not exist.

Specified by:
getTopLevelClass in interface TypeContext
Overrides:
getTopLevelClass in class DelegatingContext
Throws:
AmbiguousNameException

memberClassExists

public boolean memberClassExists(String name,
                                 TypeSystem ts)
Test whether name is an in-scope member class

Specified by:
memberClassExists in interface TypeContext
Overrides:
memberClassExists in class DelegatingContext

typeContainingMemberClass

public ClassType typeContainingMemberClass(String name,
                                           TypeSystem ts)
                                    throws AmbiguousNameException
Return the most inner type containing a class with the given name, or null if there is no such type.

Specified by:
typeContainingMemberClass in interface TypeContext
Overrides:
typeContainingMemberClass in class DelegatingContext
Throws:
AmbiguousNameException

typeVariableExists

public boolean typeVariableExists(String name,
                                  TypeSystem ts)
Test whether name is an in-scope type variable.

Specified by:
typeVariableExists in interface TypeContext
Overrides:
typeVariableExists in class DelegatingContext

getTypeVariable

public VariableType getTypeVariable(String name,
                                    TypeSystem ts)
Return the type variable with the given name, or null if it does not exist.

Specified by:
getTypeVariable in interface TypeContext
Overrides:
getTypeVariable in class DelegatingContext

getClassLoader

public ClassLoader getClassLoader()
Description copied from interface: TypeContext
Return the class loader for the current scope. Allows class loaders to be defined in later scopes with the returned loader as a parent.

Specified by:
getClassLoader in interface TypeContext
Overrides:
getClassLoader in class DelegatingContext

accessModule

public Access.Module accessModule()
Description copied from interface: TypeContext
Get the current access module.

Specified by:
accessModule in interface TypeContext
Overrides:
accessModule in class DelegatingContext