edu.mit.ai.psg.jeva
Class Package

java.lang.Object
  |
  +--edu.mit.ai.psg.jeva.Package

public class Package
extends Object
implements IPackage

Internal representation of packages, for name lookups.

Author:
CarlManning, caroma@ai.mit.edu
Copyright (c) 1997, 1998, 1999 Massachusetts Institute of Technology

Field Summary
static boolean loadVerbosely
          for debugging class loading print progress and exceptions to System.err
 
Constructor Summary
Package(String fullName, IEnv rootEnv)
           
 
Method Summary
 String getFullName()
           
 IClass getIClass(String simpleClassName)
          look up class name.
 IPackage getIPackage(String simplePackageName, boolean suppressPackageNameCheck)
          get subpackage with this name.
 String getSimpleName()
           
 IClass put(String simpleClassName, IClass aClass, boolean overwriteOldClass)
          Define a class in package, optionally overwriting old value.
protected  void setEnv(IEnv fromEnv, IEnv toEnv)
           
 String toString()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

loadVerbosely

public static boolean loadVerbosely
for debugging class loading print progress and exceptions to System.err
Constructor Detail

Package

public Package(String fullName,
               IEnv rootEnv)
Method Detail

setEnv

protected void setEnv(IEnv fromEnv,
                      IEnv toEnv)

getFullName

public String getFullName()
Specified by:
getFullName in interface IPackage

getSimpleName

public String getSimpleName()
Specified by:
getSimpleName in interface IPackage

getIPackage

public IPackage getIPackage(String simplePackageName,
                            boolean suppressPackageNameCheck)
                     throws IllegalArgumentException
get subpackage with this name. Create package if not found
Specified by:
getIPackage in interface IPackage

getIClass

public IClass getIClass(String simpleClassName)
look up class name. If not found, attempt to find by loading its compilation unit using env. a. if java file exists and is newer than class file, do first pass on java file to obtain its type names. Throws ParseException, if can't parse file, or VerifyingException if there's a type error scanning class definitions. b. if class file exists and newer than java file (or no java file) load class file, then obtain signature through reflection.
Specified by:
getIClass in interface IPackage

put

public IClass put(String simpleClassName,
                  IClass aClass,
                  boolean overwriteOldClass)
           throws IllegalArgumentException
Define a class in package, optionally overwriting old value. Returns old value. Throws IllegalArgumentException if name conflicts with a subpackage name. If overwriteOldClass is false, then signals IllegalArgumentException if name conficts with previously defined class. To erase old value, use put with value null.
Specified by:
put in interface IPackage

toString

public String toString()
Overrides:
toString in class Object

Copyright (c) 1996-1999
Massachusetts Institute of Technology

Feedback: jeva-bugs@ai.mit.edu