Class OutConnector

java.lang.Object
   |
   +----Connector
           |
           +----OutConnector

class OutConnector
extends Connector
Outconnectors are those connectors of a module that provide the output of a module.

Version:
$Revision: 1.30 $

Variable Index

 o classLoadResult
The result of the last try to load a class file by loadData().
 o connections
The Connections that are connected to this OutConnector.
 o display
Indicates wether the output associated with this OutConnector must be displayed or not.
 o fileSaveResult
The result of the last try by saveData()to have a Data class save a file.
 o lastDataSaveError
The result of the fileAvailable check that is performed before the modules are run.
 o save
Indicates wether the output associated with this OutConnector must be stored on disk or not.

Constructor Index

 o OutConnector(String, String, Module, DataType)

Method Index

 o connect(Connection)
Connect this OutConnector to a new Connection.
 o disconnect()
Disconnect all Connections from this OutConnector.
 o disconnect(Connection)
Disconnect a specified Connection from this OutConnector.
 o displayData()
Displays the Data associated with this OutConnector if this OutConnector's display option is on (true).
 o displayError()
The file was not accessible for writing, and was needed.
 o fileAvailable()
Tests if the OutConnector will be able to store its data in a file, if it needs to.
 o getConnections()
 o getData()
 o getDefaultDisplay()
 o getDefaultSave()
 o getDisplay()
 o getSave()
 o isConnected()
Indicates wether or not this Connector has one (or more) Connections.
 o saveData()
Store the Data of this OutConnector, if the save option is on.
 o setData(Data)
Set the Data this Connector needs.
 o setDisplay(boolean)
Set the "display option" of this OutConnector, which indicates wether the output associated with this OutConnector must be displayed or not.
 o setSave(boolean)
Set the "save option" of this OutConnector, which indicates wether the output associated with this OutConnector must be stored on disk or not.

Variables

 o save
 private boolean save
Indicates wether the output associated with this OutConnector must be stored on disk or not.

 o display
 private boolean display
Indicates wether the output associated with this OutConnector must be displayed or not.

 o connections
 private ConnectionStore connections
The Connections that are connected to this OutConnector.

 o classLoadResult
 private ClassLoadResult classLoadResult
The result of the last try to load a class file by loadData(). It is set by fileAvailable() and used by displayError().

See Also:
fileAvailable, displayError
 o fileSaveResult
 private FileSaveResult fileSaveResult
The result of the last try by saveData()to have a Data class save a file. It is set by saveData() and used by displayError().

See Also:
saveData, displayError
 o lastDataSaveError
 private String lastDataSaveError
The result of the fileAvailable check that is performed before the modules are run.

Constructors

 o OutConnector
 OutConnector(String userLabel,
              String fixedFileName,
              Module module,
              DataType dataType)
See Also:
Connector

Methods

 o fileAvailable
 boolean fileAvailable()
Tests if the OutConnector will be able to store its data in a file, if it needs to. Returns true in the following situations:
  1. the file exists, is a normal file and is writable.
  2. the file does not exist, but the directory in which it is to be created exists and is writable.
  3. the OutConnector does not need to save Data, because its save option is false.
Returns false otherwise. Uses fixedFileName, the name that is specified by the user of the Framework, or, if it is not set, generates a filename using method generateFileName().

Overrides:
fileAvailable in class Connector
See Also:
fixedFileName, generateFileName, fileAvailable
 o displayError
 void displayError()
The file was not accessible for writing, and was needed. Show an approriate message. Can also be called if the actual writing failed.

Overrides:
displayError in class Connector
 o setSave
 void setSave(boolean save)
Set the "save option" of this OutConnector, which indicates wether the output associated with this OutConnector must be stored on disk or not.

 o getSave
 boolean getSave()
Returns:
wether the output associated with this OutConnector must be stored on disk or not.
 o setData
 void setData(Data data)
Set the Data this Connector needs.

Overrides:
setData in class Connector
 o getData
 Data getData()
Returns:
the Data that last went through the Connections of this OutConnector or was last set using setData(). null if no Data could be found.
Overrides:
getData in class Connector
See Also:
setData
 o saveData
 boolean saveData()
Store the Data of this OutConnector, if the save option is on.

Returns:
true if the Data is successfully saved or if the Data does not need to be saved because the save option is false. false if an error occurred while trying to save the Data. The OutConnector remembers any error and can give details via method displayError().
See Also:
getSave, setSave, save, displayError
 o getConnections
 ConnectionStore getConnections()
 o connect
 void connect(Connection connection)
Connect this OutConnector to a new Connection.

Overrides:
connect in class Connector
 o disconnect
 void disconnect(Connection connection)
Disconnect a specified Connection from this OutConnector. This only affects this OutConnector. The InConnector at the other end of the Connection is not changed by this method.

Overrides:
disconnect in class Connector
See Also:
disconnect
 o disconnect
 void disconnect()
Disconnect all Connections from this OutConnector. No Connector is directly affected by this method, because it only calls the method disconnect() on each Connection. As a result of that call, the Connections may call the disconnect(Connection) method of this OutConnector.

Overrides:
disconnect in class Connector
See Also:
disconnect
 o setDisplay
 void setDisplay(boolean display)
Set the "display option" of this OutConnector, which indicates wether the output associated with this OutConnector must be displayed or not.

 o getDisplay
 boolean getDisplay()
Returns:
wether the output associated with this OutConnector must be displayed or not.
 o getDefaultSave
 boolean getDefaultSave()
Returns:
the default value for the save option. Currently, the default value is false.
 o getDefaultDisplay
 boolean getDefaultDisplay()
Returns:
the default value for the display option. Currently, the default value is false.
 o displayData
 DataVisualisation displayData()
Displays the Data associated with this OutConnector if this OutConnector's display option is on (true).

Returns:
the DataVisualisation object that was returned by the display method of the Data object, or null if this OutConnector does not display its result.
See Also:
getDisplay, setDisplay
 o isConnected
 boolean isConnected()
Indicates wether or not this Connector has one (or more) Connections.

Overrides:
isConnected in class Connector