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 $
-
classLoadResult
- The result of the last try to load a class file by
loadData().
-
connection
- The connection to which this InConnector is
connected.
-
fileLoadResult
- The result of the last try by loadData() to have a Data class
load a file.
-
lastDataLoadError
- The result of the fileAvailable check that is performed before the
modules are run.
-
serveAsNetworkInput
- See
setServeAsNetworkInput()
for the documentation of
this variable.
-
InConnector(String, String, Module, DataType)
-
-
connect(Connection)
- Connect this InConnector to a new Connection.
-
disconnect()
- Disconnect the Connection from this InConnector, if it has a
Connection.
-
disconnect(Connection)
- Disconnect the specified Connection from this InConnector.
-
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.
-
fileAvailable()
- Test if file is available to read the data of this InConnector.
-
getConnection()
-
-
getData()
-
-
getServeAsNetworkInput()
-
-
hasData()
-
-
isConnected()
- Indicates wether or not this Connector has one (or more) Connections.
-
loadData()
- Load the data for this connector from disk.
-
setData(Data)
- Set the data this connector needs.
-
setServeAsNetworkInput(boolean)
- Set the
serveAsNetworkInput
flag to a specific value.
-
toString()
-
connection
private Connection connection
- The connection to which this InConnector is
connected.
null
if this InConnector is unconnected.
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
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
lastDataLoadError
private String lastDataLoadError
- The result of the fileAvailable check that is performed before the
modules are run.
serveAsNetworkInput
private boolean serveAsNetworkInput
- See
setServeAsNetworkInput()
for the documentation of
this variable.
- See Also:
- setServeAsNetworkInput
InConnector
InConnector(String userLabel,
String fixedFileName,
Module module,
DataType dataType)
- See Also:
- Connector
getConnection
public Connection getConnection()
- Returns:
- the Connection of this Connector.
connect
void connect(Connection connection)
- Connect this InConnector to a new Connection.
- Overrides:
- connect in class Connector
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
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
fileAvailable
public boolean fileAvailable()
- Test if file is available to read the data of this InConnector.
- Overrides:
- fileAvailable in class Connector
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
getData
Data getData()
- Returns:
- the data for this connector if any is present,
null
otherwise.
- Overrides:
- getData in class Connector
setData
void setData(Data data)
- Set the data this connector needs.
- Overrides:
- setData in class Connector
hasData
public boolean hasData()
- Returns:
-
true
if there is data waiting at this connection
(or connector), false
otherwise.
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
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.
getServeAsNetworkInput
public boolean getServeAsNetworkInput()
- Returns:
- the value of the
serveAsNetworkInput
flag.
- See Also:
- setServeAsNetworkInput
isConnected
boolean isConnected()
- Indicates wether or not this Connector has one (or more) Connections.
- Overrides:
- isConnected in class Connector
toString
public String toString()
- Overrides:
- toString in class Connector