code.modules
Class CurryModule

java.lang.Object
  extended by code.modules.CurryModule
Direct Known Subclasses:
CharModule, FindallModule, IntModule, IOauxModule, IOModule, SuccessModule, SystemModule, TupleModule

public class CurryModule
extends java.lang.Object

This class stores all the information of a module, including module name, imported module names, binary code and so on. All the information in this class would be used as runtime module object, it has the same info as the compiled module file.

Class Responsibilities :

  1. Initializes all the components of this object.
  2. Print the content of this object.
Class Collaborators :
  1. Symbol

Since:
September 27, 2002
Author:
jimeng

Field Summary
private  java.util.Vector allSymbols
          All the symbols in this module
 boolean compiled
          A Boolean representing if the module was compiled or not.
 java.lang.String fileLocation
          Complete path of this module file
private  java.util.Vector imported
          Store all the imported module names
 java.lang.String moduleName
          Name of the module which is also module file name
private static java.text.SimpleDateFormat sdf
           
 int timestamp
          Module's timestamp.
 
Constructor Summary
CurryModule(java.lang.String moduleName, java.util.Vector imported, java.lang.String fileLocation, int timestamp, java.util.Vector allSymbols, boolean compiled)
          Initialize all the components of this object
 
Method Summary
 java.util.Enumeration getAllSymbolsEnumeration()
          Gets the allSymbolsEnumeration attribute of the CurryModule object
 java.util.Enumeration getImportedEnumeration()
          Gets the importedEnumeration attribute of the CurryModule object
 void printAsTxtLoadable(java.io.Writer out)
          Prints this module in a form suitable for loading as a ".txt" file.
private  void println(java.io.Writer out)
          Helper method for printing
private  void println(java.io.Writer out, java.lang.String str)
          Helper method for printing
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

moduleName

public final java.lang.String moduleName
Name of the module which is also module file name


fileLocation

public final java.lang.String fileLocation
Complete path of this module file


imported

private final java.util.Vector imported
Store all the imported module names


allSymbols

private final java.util.Vector allSymbols
All the symbols in this module


compiled

public final boolean compiled
A Boolean representing if the module was compiled or not. Built-in modules are not compiled. A compiled program is a compiled module.


timestamp

public final int timestamp
Module's timestamp. This is contained in the module file.


sdf

private static final java.text.SimpleDateFormat sdf
Constructor Detail

CurryModule

public CurryModule(java.lang.String moduleName,
                   java.util.Vector imported,
                   java.lang.String fileLocation,
                   int timestamp,
                   java.util.Vector allSymbols,
                   boolean compiled)
Initialize all the components of this object

Parameters:
moduleName - The module's name.
imported - A vector of all the imported module names. new Vector() for internal modules.
fileLocation - The complete path of this module file. null for internal modules.
timestamp - The module's timestamp as specified in the module file. 0 for internal modules.
allSymbols - A vector of allSymbols.
compiled - true if this module is a compiled module. false for internal modules.
Method Detail

getImportedEnumeration

public java.util.Enumeration getImportedEnumeration()
Gets the importedEnumeration attribute of the CurryModule object

Returns:
The importedEnumeration value

getAllSymbolsEnumeration

public java.util.Enumeration getAllSymbolsEnumeration()
Gets the allSymbolsEnumeration attribute of the CurryModule object

Returns:
The allSymbolsEnumeration value

println

private void println(java.io.Writer out)
Helper method for printing

Parameters:
out -

println

private void println(java.io.Writer out,
                     java.lang.String str)
Helper method for printing

Parameters:
out -
str -

printAsTxtLoadable

public void printAsTxtLoadable(java.io.Writer out)
Prints this module in a form suitable for loading as a ".txt" file.