jeops.compiler
Class ImportList

java.lang.Object
  |
  +--jeops.compiler.ImportList

public class ImportList
extends java.lang.Object

A list of import statements.

Version:
0.01 09.03.2000
Author:
Carlos Figueira Filho (csff@cin.ufpe.br)

Field Summary
private  java.util.Vector genericImportStatements
          The set of generic import statements.
private  java.util.Vector specificImportStatements
          The set of specific import statements.
 
Constructor Summary
ImportList()
          Class constructor for rule bases in the default package.
ImportList(java.lang.String packageName)
          Class constructor.
 
Method Summary
 void addImport(java.lang.String statement)
          Adds an import statement to this list.
 java.lang.Class getRepresentingClass(java.lang.String ident)
          Returns the class that is represented by the given identifier for this import list.
 java.lang.String[] possibleFileNames(java.lang.String ident)
          Returns the possible file names an identifier can represent, based on this import list.
 
Methods inherited from class java.lang.Object
, clone, equals, finalize, getClass, hashCode, notify, notifyAll, registerNatives, toString, wait, wait, wait
 

Field Detail

genericImportStatements

private java.util.Vector genericImportStatements
The set of generic import statements. A generic import statement is one such as
import java.util.*;

specificImportStatements

private java.util.Vector specificImportStatements
The set of specific import statements. A specific import statement is one such as
import java.util.Vector;
Constructor Detail

ImportList

public ImportList()
Class constructor for rule bases in the default package.

ImportList

public ImportList(java.lang.String packageName)
Class constructor.
Parameters:
packageName - the package of the rule base.
Method Detail

possibleFileNames

public java.lang.String[] possibleFileNames(java.lang.String ident)
Returns the possible file names an identifier can represent, based on this import list.
Parameters:
ident - the name of the identifier.
Returns:
the possible file names an identifier can represent, based on this import list.

addImport

public void addImport(java.lang.String statement)
Adds an import statement to this list.
Parameters:
statement - the statement to be added.

getRepresentingClass

public java.lang.Class getRepresentingClass(java.lang.String ident)
                                     throws java.lang.ClassNotFoundException,
                                            ImportException
Returns the class that is represented by the given identifier for this import list.
Parameters:
ident - the identifier that represents a class.
Returns:
a set of classes that can be represented by the given identifier.
Throws:
java.lang.ClassNotFoundException - if the ident doesn't represent any class, given the import statements of this list.
ImportException - if the ident represents more than one class, given the import statements of this list.