org.jscience.computing.ai.expertsystem.compiler
Class ImportList

java.lang.Object
  extended by org.jscience.computing.ai.expertsystem.compiler.ImportList

public class ImportList
extends java.lang.Object

A list of 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, toString, wait, wait, wait
 

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.