openjava.mop
Class ClassEnvironment

java.lang.Object
  |
  +--openjava.mop.Environment
        |
        +--openjava.mop.ClosedEnvironment
              |
              +--openjava.mop.ClassEnvironment

public final class ClassEnvironment
extends ClosedEnvironment


Nested Class Summary
 
Nested classes inherited from class openjava.mop.Environment
Environment.BasicVariableInfo, Environment.VariableInfo
 
Field Summary
private  String className
           
(package private)  Hashtable mapAnonDeclToClass
          Maps AllocationExpressions to the names ("1", etc.) of the inner classes which have been implicitly created for them.
private  Vector memberClasses
           
 
Fields inherited from class openjava.mop.ClosedEnvironment
symbol_table, table
 
Fields inherited from class openjava.mop.Environment
parent
 
Constructor Summary
ClassEnvironment(Environment e)
           
ClassEnvironment(Environment e, OJClass clazz)
           
ClassEnvironment(Environment e, String name)
           
 
Method Summary
private  String askParent(String sname)
           
 String currentClassName()
           
 ClassEnvironment getClassEnvironmentParent()
          Gets the nearest ancestor which is a ClassEnvironment, or null.
 String getClassName()
           
private static String getFirst(String qname)
           
 Vector getMemberClasses()
           
private static String getRest(String qname)
           
 Environment.VariableInfo lookupBind(String name)
          Looks up a binded type of the given variable or field name.
 OJClass lookupClass(String name)
          Looks a class object up.
private static OJField pickupField(OJClass[] reftypes, String name)
           
 void recordClassName(String name)
           
 void recordMemberClass(String name)
           
 void recordMemberClass(String declarerName, String innerName)
          If this is a ClassEnvironment for declarerName, record new inner class innerName; otherwise, pass up the environment hierarchy.
 String toQualifiedName(String name)
          Obtains the fully-qualified name of the given class name.
 String toString()
           
 
Methods inherited from class openjava.mop.ClosedEnvironment
bindVariable, record
 
Methods inherited from class openjava.mop.Environment
bindVariable, getGlobalEnvironment, getPackage, getParent, isBind, isQualifiedName, isRegisteredModifier, lookupClass, toPackageName, toSimpleName
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

className

private String className

memberClasses

private Vector memberClasses

mapAnonDeclToClass

Hashtable mapAnonDeclToClass
Maps AllocationExpressions to the names ("1", etc.) of the inner classes which have been implicitly created for them. See Toolbox.lookupAnonymousClass(openjava.mop.ClassEnvironment, openjava.ptree.AllocationExpression).

Constructor Detail

ClassEnvironment

public ClassEnvironment(Environment e,
                        String name)

ClassEnvironment

public ClassEnvironment(Environment e)

ClassEnvironment

public ClassEnvironment(Environment e,
                        OJClass clazz)
Method Detail

getClassEnvironmentParent

public ClassEnvironment getClassEnvironmentParent()
Description copied from class: Environment
Gets the nearest ancestor which is a ClassEnvironment, or null.

Overrides:
getClassEnvironmentParent in class Environment

getClassName

public String getClassName()

getMemberClasses

public Vector getMemberClasses()

toString

public String toString()
Overrides:
toString in class ClosedEnvironment

recordClassName

public void recordClassName(String name)

recordMemberClass

public void recordMemberClass(String name)

recordMemberClass

public void recordMemberClass(String declarerName,
                              String innerName)
Description copied from class: Environment
If this is a ClassEnvironment for declarerName, record new inner class innerName; otherwise, pass up the environment hierarchy.

Overrides:
recordMemberClass in class Environment
Parameters:
declarerName - fully-qualified name of enclosing class
innerName - simple name of inner class

lookupClass

public OJClass lookupClass(String name)
Description copied from class: Environment
Looks a class object up.

Overrides:
lookupClass in class ClosedEnvironment
Parameters:
name - the name of the fully-qualified name of the class looked for

lookupBind

public Environment.VariableInfo lookupBind(String name)
Description copied from class: Environment
Looks up a binded type of the given variable or field name.

Overrides:
lookupBind in class ClosedEnvironment
Parameters:
name - the fully-qualified name of the class

pickupField

private static OJField pickupField(OJClass[] reftypes,
                                   String name)

toQualifiedName

public String toQualifiedName(String name)
Obtains the fully-qualified name of the given class name.

Overrides:
toQualifiedName in class Environment
Parameters:
name - a simple class name or a fully-qualified class name
Returns:
the fully-qualified name of the class

getFirst

private static final String getFirst(String qname)

getRest

private static final String getRest(String qname)

askParent

private String askParent(String sname)

currentClassName

public String currentClassName()
Overrides:
currentClassName in class Environment

SourceForge.net_Logo