ptolemy.vergil.kernel
Class Link

java.lang.Object
  extended by ptolemy.vergil.kernel.Link

public class Link
extends java.lang.Object

Instances of this class represent a link between a port and a relation, between two relations, or a between two ports. In the first two cases, the relations are represented by an explicit node in the graph. In the third case, there is no explicit node representing the relation and the edge runs directly from one port to the other. Connections are made and broken by the graph model depending on which of the above contexts the link is being used in.

Since:
Ptolemy II 2.0
Version:
$Id: Link.java 47513 2007-12-07 06:32:21Z cxh $
Author:
Steve Neuendorffer
Accepted Rating:
Red (johnr)
Proposed Rating:
Red (eal)

Field Summary
private  java.lang.Object _head
           
private  ComponentRelation _relation
           
private  java.lang.Object _tail
           
 
Constructor Summary
Link()
           
 
Method Summary
 java.lang.Object getHead()
          Return the head of this link.
 ComponentRelation getRelation()
          Return the relation that this link represents.
 java.lang.Object getTail()
          Return the tail of this link.
 void setHead(java.lang.Object head)
          Set the head of this link.
 void setRelation(ComponentRelation relation)
          Set the relation for this link.
 void setTail(java.lang.Object tail)
          Set the tail of this link.
 java.lang.String toString()
          Return a string representation of this link.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

_head

private java.lang.Object _head

_tail

private java.lang.Object _tail

_relation

private ComponentRelation _relation
Constructor Detail

Link

public Link()
Method Detail

getHead

public java.lang.Object getHead()
Return the head of this link. This may be a port, or a vertex in a relation.

Returns:
The head of this link.
See Also:
setHead(Object)

getRelation

public ComponentRelation getRelation()
Return the relation that this link represents. If the link goes from a port to a port, then this is the only way to get at the relation. If the link goes from a vertex to a port, then the relation will be the container of the vertex.

Returns:
The relation that this link represents.
See Also:
setRelation(ComponentRelation)

getTail

public java.lang.Object getTail()
Return the tail of this link. This may be a port, or a vertex in a relation.

Returns:
The tail of this link.
See Also:
setTail(Object)

setHead

public void setHead(java.lang.Object head)
Set the head of this link. This may be a port, or a vertex in a relation.

Parameters:
head - The head.
See Also:
getHead()

setRelation

public void setRelation(ComponentRelation relation)
Set the relation for this link.

Parameters:
relation - The relation.
See Also:
getRelation()

setTail

public void setTail(java.lang.Object tail)
Set the tail of this link. This may be a port, or a vertex in a relation.

Parameters:
tail - The tail.
See Also:
getTail()

toString

public java.lang.String toString()
Return a string representation of this link.

Overrides:
toString in class java.lang.Object
Returns:
A string representation of this link.