Class Link

  • Direct Known Subclasses:
    Arc

    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$
    Author:
    Steve Neuendorffer
    Pt.AcceptedRating:
    Red (johnr)
    Pt.ProposedRating:
    Red (eal)
    • Constructor Summary

      Constructors 
      Constructor Description
      Link()  
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      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
    • 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.