Class Connection

java.lang.Object
   |
   +----Connection

class Connection
extends Object
implements StoreElement
A connection between an InConnector and an OutConnector.

Version:
$Revision: 1.11 $
See Also:
InConnector, OutConnector

Variable Index

 o inConnector
The InConnector of the Connection; that's where the Connection ends.
 o network
The Network this Connection is part of.
 o outConnector
The OutConnector of the Connection; that's where the Connection originates.

Constructor Index

 o Connection(Network, InConnector, OutConnector)

Method Index

 o connect()
Connect the InConnector and the OutConnector to this Connection.
 o disconnect()
Disconnect the InConnector and the OutConnector from this Connection.
 o getData()
 o getDescriptiveString()
 o getInConnector()
 o getOutConnector()
 o isConnectable(InConnector, OutConnector)
Checks if a specified InConnector can be connected to a specified OutConnector.
 o setData(Data)
Accept data that `flows' through this connection.
 o setInConnector(InConnector)
Set a new InConnector for this Connection.
 o setOutConnector(OutConnector)
Set a new OutConnector for this Connection.

Variables

 o network
 private Network network
The Network this Connection is part of.

 o inConnector
 private InConnector inConnector
The InConnector of the Connection; that's where the Connection ends.

 o outConnector
 private OutConnector outConnector
The OutConnector of the Connection; that's where the Connection originates.

Constructors

 o Connection
 Connection(Network network,
            InConnector initialInConnector,
            OutConnector initialOutConnector)
Parameters:
initialInConnector - an initial value for the InConnector of this Connection. It may change later.
initialOutConnector - an initial value for the OutConnector of this Connection. May also change later.

Methods

 o getInConnector
 InConnector getInConnector()
Returns:
the InConnector where this Connection ends.
 o setInConnector
 void setInConnector(InConnector c)
Set a new InConnector for this Connection.

 o getOutConnector
 OutConnector getOutConnector()
Returns:
the OutConnector where this Connection originates.
 o setOutConnector
 void setOutConnector(OutConnector c)
Set a new OutConnector for this Connection.

 o getData
 Data getData()
Returns:
the last Data that was passed through this Connection. This Data is still stored at the InConnector of the Connection. null if no Data is present at the InConnector.
 o setData
 void setData(Data data)
Accept data that `flows' through this connection. The data comes from the OutConnector and goes to the InConnector. It is stored at the InConnector.

Parameters:
data - the data that flows through this connection.
 o getDescriptiveString
 public String getDescriptiveString()
Returns:
a String that describes the Connection in such a way that it can be used in load and save network.
See Also:
loadNetwork, saveNetwork
 o connect
 void connect()
Connect the InConnector and the OutConnector to this Connection. NYI: Ideally, this should be done in the constructor of this class, otherwise it is possible to have unconnected Connections, which would make the data structures of the program invalid.

 o disconnect
 void disconnect()
Disconnect the InConnector and the OutConnector from this Connection. This makes the Connection invalid. Most of its methods cannot be used anymore after a call to this method.

 o isConnectable
 static boolean isConnectable(InConnector inConnector,
                              OutConnector outConnector)
Checks if a specified InConnector can be connected to a specified OutConnector. NYI: This check is not yet complete. Only the two specified Connectors are considered. In the final check, the complete Network should be checked for incompatible logical types.

Returns:
true if the two Connectors can be connected, false if they can't.