Class Module
java.lang.Object
|
+----Module
- class Module
- extends Object
- implements StoreElement
An occurrance of a module in a network.
- Version:
- $Revision: 1.81 $
- See Also:
- ModuleType, Network
-
endModule
-
-
inConnectors
-
-
marked
- A module can be marked for several reasons.
-
messagesDialog
-
-
moduleCode
- An instance of the class that implements the algoritm of the module.
-
moduleLoadResult
- The result of the last try to load a class file by prepareToRun().
-
moduleType
-
-
network
-
-
outConnectors
-
-
parameters
-
-
partOfModel
- This boolean indicates if the Module has been added to the model of
the Model-View-Controller triad of the program.
-
startModule
-
-
Module(Network, String)
-
-
checkOutput(DataStore)
- Check if the Data objects in a DataStore have the types for the
OutConnectors described in the module description file of this module.
-
clearData()
- Remove the Data of all Connectors.
-
disconnect()
- Disconnect all Connections to or from this Module.
-
displayError()
-
-
displayOutput()
- Ask all OutConnectors to display their Data.
-
distributeOutput(DataStore)
- Distribute the data in a specific DataStore over the OutConnectors of
the module.
-
finalize()
-
-
getCodeClassFilename()
-
-
getDescriptiveString()
-
-
getInConnector(int)
-
-
getInConnectors()
- Return the InConnectors of the Module.
-
getMDFileName()
-
-
getModuleDescription()
-
-
getName()
-
-
getNetwork()
-
-
getNrOfInConnectors()
-
-
getNrOfOutConnectors()
-
-
getNrOfParameters()
-
-
getOutConnector(int)
-
-
getOutConnectors()
- Return the OutConnectors of the Module.
-
getParameter(int)
- Get a single parameter from the parameter store.
-
getParameters()
- Return the Parameters of the Module.
-
getType()
-
-
isEndModule()
-
-
isMarked()
-
-
isStartModule()
-
-
markIt()
-
-
prepareToRun()
- This method creates an instance of the class with the code for the
Module.
-
readMDFile(String)
- Read the Module Description File from disk.
-
resultText(int)
-
-
run()
-
-
saveOutput()
- Ask all OutConnectors to save their Data.
-
setEndModule(boolean)
-
-
setStartModule(boolean)
-
-
toString()
-
-
unMarkIt()
-
network
private Network network
messagesDialog
private MessagesDialog messagesDialog
moduleType
private ModuleType moduleType
inConnectors
private InConnectorStore inConnectors
outConnectors
private OutConnectorStore outConnectors
parameters
private ParameterStore parameters
startModule
private boolean startModule
endModule
private boolean endModule
moduleCode
private Modulable moduleCode
- An instance of the class that implements the algoritm of the module.
This object is used when the method run() of this module is called.
It is setup by method prepareToRun().
After use this reference should be set to null because the object
cannot be garbage collected while there are still references to it.
When all instances of a class are gone, the class itself can be
reloaded if there is a new version of it.
- See Also:
- run, prepareToRun
moduleLoadResult
private ClassLoadResult moduleLoadResult
- The result of the last try to load a class file by prepareToRun(). It
is set by prepareToRun() and used by displayError().
- See Also:
- prepareToRun, displayError
marked
private boolean marked
- A module can be marked for several reasons. Examples of this are: When
the runpath of the network is determined to indicate what modules are in
the runpath or when the network is checked for loops.
partOfModel
boolean partOfModel
- This boolean indicates if the Module has been added to the model of
the Model-View-Controller triad of the program. If it has been added,
the Views must be notified if something in the Module changes. If it
has not been added, the Views must not be notified because the Views
should only get events on objects that are part of the model. This
boolean serves as a temporary fix to make it possible to load
Networks. When storing view-specific information in the model is
implemented, this can change and this variable can be removed. The
NetworkObservable uses this boolean to suppress any notifications of
the Views for Modules (or its Connectors) which are not part of a
model. This boolean is set by the makeModule() and addModule()
methods of class Network.
Module
Module(Network network,
String MDFileName)
getMDFileName
String getMDFileName()
getName
String getName()
getModuleDescription
String getModuleDescription()
getCodeClassFilename
String getCodeClassFilename()
getInConnector
InConnector getInConnector(int conNr)
getOutConnector
OutConnector getOutConnector(int conNr)
getNetwork
public Network getNetwork()
getNrOfInConnectors
int getNrOfInConnectors()
getNrOfOutConnectors
int getNrOfOutConnectors()
setStartModule
void setStartModule(boolean status)
setEndModule
void setEndModule(boolean status)
isStartModule
boolean isStartModule()
isEndModule
boolean isEndModule()
markIt
public void markIt()
unMarkIt
public void unMarkIt()
isMarked
public boolean isMarked()
getParameter
Parameter getParameter(int parameterNr)
- Get a single parameter from the parameter store.
- Parameters:
- parameterNr - The number of the parameter that is requested.
getNrOfParameters
int getNrOfParameters()
readMDFile
boolean readMDFile(String MDFileName)
- Read the Module Description File from disk.
The module description file is read from disk and stored in the interal
representation.
toString
public String toString()
- Overrides:
- toString in class Object
prepareToRun
public boolean prepareToRun()
- This method creates an instance of the class with the code for the
Module. References to this instance should be set to null after use
because the instance and its class cannot be garbage collected
otherwise.
run
public void run()
finalize
public void finalize() throws Throwable
- Throws: Throwable
- never.
- Overrides:
- finalize in class Object
displayError
public void displayError()
getInConnectors
public InConnectorStore getInConnectors()
- Return the InConnectors of the Module.
- See Also:
- InConnectorStore
getOutConnectors
public OutConnectorStore getOutConnectors()
- Return the OutConnectors of the Module.
- See Also:
- OutConnectorStore
getParameters
public ParameterStore getParameters()
- Return the Parameters of the Module.
- See Also:
- ParameterStore
checkOutput
private boolean checkOutput(DataStore output)
- Check if the Data objects in a DataStore have the types for the
OutConnectors described in the module description file of this module.
- Parameters:
- output - the DataStore containing the data to be checked.
- Returns:
-
true
if the data can be accepted as correct
output of this module, false
otherwise.
distributeOutput
private void distributeOutput(DataStore output)
- Distribute the data in a specific DataStore over the OutConnectors of
the module.
- Parameters:
- output - the DataStore containing the data to be distributed.
clearData
void clearData()
- Remove the Data of all Connectors.
saveOutput
private void saveOutput()
- Ask all OutConnectors to save their Data. They will do this if
necessary.
displayOutput
private DataVisualisationStore displayOutput()
- Ask all OutConnectors to display their Data. They will do this if
necessary.
resultText
String resultText(int result)
getType
ModuleType getType()
- Returns:
- a reference to the ModuleType representing the type of this
Module.
disconnect
void disconnect()
- Disconnect all Connections to or from this Module.
getDescriptiveString
public String getDescriptiveString()
- Returns:
- a String that describes the Module in such a way that it
can be used in load and save network.
- See Also:
- loadNetwork, saveNetwork