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
-
inConnector
- The InConnector of the Connection; that's where the Connection ends.
-
network
- The Network this Connection is part of.
-
outConnector
- The OutConnector of the Connection; that's where the
Connection originates.
-
Connection(Network, InConnector, OutConnector)
-
-
connect()
- Connect the InConnector and the OutConnector to this Connection.
-
disconnect()
- Disconnect the InConnector and the OutConnector from this Connection.
-
getData()
-
-
getDescriptiveString()
-
-
getInConnector()
-
-
getOutConnector()
-
-
isConnectable(InConnector, OutConnector)
- Checks if a specified
InConnector
can be connected to a
specified OutConnector
.
-
setData(Data)
- Accept data that `flows' through this connection.
-
setInConnector(InConnector)
- Set a new InConnector for this Connection.
-
setOutConnector(OutConnector)
- Set a new OutConnector for this Connection.
network
private Network network
- The Network this Connection is part of.
inConnector
private InConnector inConnector
- The InConnector of the Connection; that's where the Connection ends.
outConnector
private OutConnector outConnector
- The OutConnector of the Connection; that's where the
Connection originates.
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.
getInConnector
InConnector getInConnector()
- Returns:
- the InConnector where this Connection ends.
setInConnector
void setInConnector(InConnector c)
- Set a new InConnector for this Connection.
getOutConnector
OutConnector getOutConnector()
- Returns:
- the OutConnector where this Connection originates.
setOutConnector
void setOutConnector(OutConnector c)
- Set a new OutConnector for this Connection.
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.
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.
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
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.
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.
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 Connector
s are
considered. In the final check, the complete Network
should be checked for incompatible logical types.
- Returns:
-
true
if the two Connector
s can be
connected, false
if they can't.