Class InConnector

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

class InConnector
extends Connector
Inconnectors are those connectors of a module that provide the input for a module.

Version:
$Revision: 1.24 $

Variable Index

 o classLoadResult
The result of the last try to load a class file by loadData().
 o connection
The connection to which this InConnector is connected.
 o fileLoadResult
The result of the last try by loadData() to have a Data class load a file.
 o lastDataLoadError
The result of the fileAvailable check that is performed before the modules are run.
 o serveAsNetworkInput
See setServeAsNetworkInput() for the documentation of this variable.

Constructor Index

 o InConnector(String, String, Module, DataType)

Method Index

 o connect(Connection)
Connect this InConnector to a new Connection.
 o disconnect()
Disconnect the Connection from this InConnector, if it has a Connection.
 o disconnect(Connection)
Disconnect the specified Connection from this InConnector.
 o displayError()
Called when the input file was not accessible for reading, and was needed, when the Data class could not be loaded or when the data could not be loaded by the Data class.
 o fileAvailable()
Test if file is available to read the data of this InConnector.
 o getConnection()
 o getData()
 o getServeAsNetworkInput()
 o hasData()
 o isConnected()
Indicates wether or not this Connector has one (or more) Connections.
 o loadData()
Load the data for this connector from disk.
 o setData(Data)
Set the data this connector needs.
 o setServeAsNetworkInput(boolean)
Set the serveAsNetworkInput flag to a specific value.
 o toString()

Variables

 o connection
 private Connection connection
The connection to which this InConnector is connected. null if this InConnector is unconnected.

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

See Also:
loadData, fileAvailable, displayError
 o fileLoadResult
 private FileLoadResult fileLoadResult
The result of the last try by loadData() to have a Data class load a file. It is set by loadData() and used by displayError().

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

 o serveAsNetworkInput
 private boolean serveAsNetworkInput
See setServeAsNetworkInput() for the documentation of this variable.

See Also:
setServeAsNetworkInput

Constructors

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

Methods

 o getConnection
 public Connection getConnection()
Returns:
the Connection of this Connector.
 o connect
 void connect(Connection connection)
Connect this InConnector to a new Connection.

Overrides:
connect in class Connector
 o disconnect
 void disconnect(Connection connection)
Disconnect the specified Connection from this InConnector. This only affects this InConnector. The OutConnector 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 the Connection from this InConnector, if it has a Connection. No Connector is directly affected by this method, because it only calls the method disconnect() on the Connection. As a result of that call, the Connection may call the disconnect(Connection) method of this InConnector.

Overrides:
disconnect in class Connector
See Also:
disconnect
 o fileAvailable
 public boolean fileAvailable()
Test if file is available to read the data of this InConnector.

Overrides:
fileAvailable in class Connector
 o displayError
 public void displayError()
Called when the input file was not accessible for reading, and was needed, when the Data class could not be loaded or when the data could not be loaded by the Data class. The reason of the call to this method is determined by looking at the fileLoadError and classLoadError variables. Then an approriate message is shown.

Overrides:
displayError in class Connector
 o getData
 Data getData()
Returns:
the data for this connector if any is present, null otherwise.
Overrides:
getData in class Connector
 o setData
 void setData(Data data)
Set the data this connector needs.

Overrides:
setData in class Connector
 o hasData
 public boolean hasData()
Returns:
true if there is data waiting at this connection (or connector), false otherwise.
 o loadData
 public boolean loadData()
Load the data for this connector from disk. First make a new instance of the class that implements the data object. Then let the new instance load data for itself from the file which name was determined by the last call to fileAvailable().

Returns:
a boolean indicating wether the loading was successfull or not.
See Also:
getCodeClass, fileAvailable, lastFileName
 o setServeAsNetworkInput
 public void setServeAsNetworkInput(boolean flag)
Set the serveAsNetworkInput flag to a specific value. This flag indicates if the Connector serves as input to a network. In this sense, network just means: a set of modules. A connector of one of the modules in such a network serves as input for the network if it has no connection to any of the other modules in the network. When the network is run, all input connectors of the network need to read their data from a file, because they won't receive data from other modules. Since the network topology can change, either by changing connections or by changing start or end modules, the value of this flag is only temporarily.

Parameters:
flag - the new value for the flag.
 o getServeAsNetworkInput
 public boolean getServeAsNetworkInput()
Returns:
the value of the serveAsNetworkInput flag.
See Also:
setServeAsNetworkInput
 o isConnected
 boolean isConnected()
Indicates wether or not this Connector has one (or more) Connections.

Overrides:
isConnected in class Connector
 o toString
 public String toString()
Overrides:
toString in class Connector