edu.jhu.ece.iacl.jist.pipeline
Class PipeConnector

java.lang.Object
  extended by edu.jhu.ece.iacl.jist.pipeline.PipeConnector

public class PipeConnector
extends java.lang.Object

A Pipe Connector provides a connection between an input and output port.

Author:
Blake Lucas

Field Summary
protected  PipePort dest
          destination port.
protected  PipeModuleEdge gedge
          graph edge representing this connector.
protected  PipePort src
          source port.
protected  int srcIndex
          index into source if port can accept multiple connections.
 
Constructor Summary
  PipeConnector()
          Default constructor.
protected PipeConnector(PipePort head, PipePort tail)
          Default constructor.
protected PipeConnector(PipePort head, PipePort tail, PipeModuleEdge edge)
          Create connection between a source and destination.
 
Method Summary
static PipeConnector connect(PipePort head, PipePort tail)
          Connect source port to destination.
static PipeConnector connect(PipePort head, PipePort tail, PipeModuleEdge edge)
          Connect source port to destination.
 void disconnect()
          Remove this connection from the source and destination port.
 PipePort getDestination()
          Get destination port.
 PipeModuleEdge getGraphEdge()
          Get graph edge.
 PipePort getSource()
          Get source port.
 int getSourceIndex()
          Get source index if port accepts multiple connections.
static boolean isCompatible(PipePort head, PipePort tail)
          Returns true if source port can be safely connected to destination port and the connection will not create loops in the graph.
 void setDestination(PipePort dst)
          Set destination port.
 void setGraphEdge(PipeModuleEdge edge)
          Set graph edge used to render this connector.
 void setSource(PipePort src)
          Set source port.
 void setSourceIndex(int i)
          Set the index into the source if the source is a variable collection of different parameters.
 java.lang.String toString()
          Get description of connection.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

src

protected PipePort src
source port.


dest

protected PipePort dest
destination port.


srcIndex

protected int srcIndex
index into source if port can accept multiple connections.


gedge

protected transient PipeModuleEdge gedge
graph edge representing this connector.

Constructor Detail

PipeConnector

public PipeConnector()
Default constructor.


PipeConnector

protected PipeConnector(PipePort head,
                        PipePort tail)
Default constructor.

Parameters:
head - source port
tail - destination port

PipeConnector

protected PipeConnector(PipePort head,
                        PipePort tail,
                        PipeModuleEdge edge)
Create connection between a source and destination.

Parameters:
head - source port
tail - destination port
edge - graph edge
Method Detail

connect

public static PipeConnector connect(PipePort head,
                                    PipePort tail)
Connect source port to destination.

Parameters:
head - source port
tail - destination port
Returns:
the pipe connector

connect

public static PipeConnector connect(PipePort head,
                                    PipePort tail,
                                    PipeModuleEdge edge)
Connect source port to destination.

Parameters:
head - source port
tail - destination port
edge - graph edge
Returns:
the pipe connector

isCompatible

public static boolean isCompatible(PipePort head,
                                   PipePort tail)
Returns true if source port can be safely connected to destination port and the connection will not create loops in the graph.

Parameters:
head - source port
tail - destination port
Returns:
true if compatible

disconnect

public void disconnect()
Remove this connection from the source and destination port.


getDestination

public PipePort getDestination()
Get destination port.

Returns:
destination port

getGraphEdge

public PipeModuleEdge getGraphEdge()
Get graph edge.

Returns:
graph edge

getSource

public PipePort getSource()
Get source port.

Returns:
source port

getSourceIndex

public int getSourceIndex()
Get source index if port accepts multiple connections.

Returns:
the source index

setDestination

public void setDestination(PipePort dst)
Set destination port.

Parameters:
dst - destination port

setGraphEdge

public void setGraphEdge(PipeModuleEdge edge)
Set graph edge used to render this connector.

Parameters:
edge - the edge

setSource

public void setSource(PipePort src)
Set source port.

Parameters:
src - source port

setSourceIndex

public void setSourceIndex(int i)
Set the index into the source if the source is a variable collection of different parameters.

Parameters:
i - index

toString

public java.lang.String toString()
Get description of connection.

Overrides:
toString in class java.lang.Object
Returns:
the string