Class Connector

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

abstract class Connector
extends Object
implements StoreElement
Connectors represent the input and output of a module. Two Connectors of different modules, but of the same type, can be connected to each other using a Connection.

Version:
$Revision: 1.39 $
See Also:
Connector

Variable Index

 o data
Data that is waiting at this Connector.
 o dataType
The dataType contains the type information of a Connector.
 o fixedFileName
The name the user of the Framework specified for the file for the Data of this Connector.
 o lastFileName
The name of the file for the Data of this Connector as it was constructed when the file was last used.
 o module
The Module this Connector is a part of.
 o userLabel
The user label is used to make a distinction between 2 in- or outconnectors that have the same type (DataType).

Constructor Index

 o Connector(String, String, Module, DataType)

Method Index

 o connect(Connection)
Connect this Connector to a new Connection.
 o disconnect()
Disconnect all Connections from this Connector.
 o disconnect(Connection)
Disconnect a specified Connection from this Connector.
 o displayError()
Called to let the Connector display an appropriate message after an file or Data class could not be read from or written to.
 o fileAvailable()
Test if file is available for the Data of this Connector.
 o generateFileName()
Construct a filename from the basename, this Connector's user label, the logical type (tag) (if present) and physical type (tag) of the DataType of this Connector.
 o getData()
 o getDataType()
Get the DataType of a Connector.
 o getFixedFileName()
 o getModule()
 o getUserLabel()
Get the userlabel of a Connector.
 o isConnected()
Indicates wether or not this Connector has one (or more) Connections.
 o setData(Data)
Set the Data this Connector needs.
 o setDataType(DataType)
Set the DataType of a Connector.
 o setFixedFileName(String)
Set the name for the file for the Data of this Connector.
 o setUserLabel(String)
Set the userlabel of a Connector.
 o string2Connector(String[])
If the MDFile provides a user label store it in this class.
 o toString()

Variables

 o userLabel
 protected String userLabel
The user label is used to make a distinction between 2 in- or outconnectors that have the same type (DataType). Two in/outconnectors may not have the same type because the all data streams between modules (which are identified by the connector types) must have different types.

 o module
 protected Module module
The Module this Connector is a part of.

 o dataType
 protected DataType dataType
The dataType contains the type information of a Connector. So two identical Connectors have two Connector objects and one DataType.

 o lastFileName
 protected String lastFileName
The name of the file for the Data of this Connector as it was constructed when the file was last used. The name is either generated by the Framework using generateFileName(), or specified by the user of the Framework, in which case it is set using setFixedFileName().

See Also:
generateFileName, setFixedFileName, getFixedFileName, fixedFileName
 o fixedFileName
 protected String fixedFileName
The name the user of the Framework specified for the file for the Data of this Connector. This variable contains null if no name has been set. The default fixed filename can be found in DataType.

See Also:
setFixedFileName, getFixedFileName, lastFileName, defaultFixedFileName
 o data
 protected Data data
Data that is waiting at this Connector. null if there is no Data waiting.

Constructors

 o Connector
 Connector(String userLabel,
           String fixedFileName,
           Module module,
           DataType dataType)
Parameters:
userLabel - the inital value for the user label.
module - the module this Connector is a part of.
dataType - the data type of the Connector.

Methods

 o getUserLabel
 String getUserLabel()
Get the userlabel of a Connector.

 o setUserLabel
 void setUserLabel(String userLabel)
Set the userlabel of a Connector.

 o getDataType
 DataType getDataType()
Get the DataType of a Connector.

 o setDataType
 void setDataType(DataType dataType)
Set the DataType of a Connector.

 o string2Connector
 void string2Connector(String cleanLines[])
If the MDFile provides a user label store it in this class.

 o getModule
 Module getModule()
Returns:
the Module this Connector is part of.
 o fileAvailable
 abstract boolean fileAvailable()
Test if file is available for the Data of this Connector. The name of the file is either constructed by the Framework (see generateFileName) or specified by the user of the Framework using setFixedFileName().

See Also:
generateFileName, setFixedFileName
 o displayError
 abstract void displayError()
Called to let the Connector display an appropriate message after an file or Data class could not be read from or written to.

 o setData
 abstract void setData(Data data)
Set the Data this Connector needs.

 o getData
 abstract Data getData()
Returns:
the Data for this Connector if any is present, null otherwise.
 o connect
 abstract void connect(Connection connection)
Connect this Connector to a new Connection.

 o disconnect
 abstract void disconnect(Connection connection)
Disconnect a specified Connection from this Connector. This only affects this Connector. The Connector at the other end of the Connection is not changed by this method.

See Also:
disconnect
 o disconnect
 abstract void disconnect()
Disconnect all Connections from this Connector. 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 Connector.

See Also:
disconnect
 o generateFileName
 protected String generateFileName()
Construct a filename from the basename, this Connector's user label, the logical type (tag) (if present) and physical type (tag) of the DataType of this Connector. This name is used by the Connector to save or load Data if no specific name is specified.

See Also:
getLogicalTypeTag, getPhysicalTypeTag
 o setFixedFileName
 void setFixedFileName(String name)
Set the name for the file for the Data of this Connector. If no name is set, the Framework generates a name using generateFileName(). Specifying null or an empty String as a name makes the name for the file unset.

See Also:
generateFileName, getFixedFileName, fixedFileName
 o getFixedFileName
 String getFixedFileName()
Returns:
the name for the file for the Data of this Connector as set by the user of the Framework or null if no name has been set.
See Also:
setFixedFileName, fixedFileName
 o isConnected
 abstract boolean isConnected()
Indicates wether or not this Connector has one (or more) Connections.

 o toString
 public String toString()
Overrides:
toString in class Object