net.ggtools.grand.graph
Class LinkImpl

java.lang.Object
  extended by net.ggtools.grand.graph.AttributeManager
      extended by net.ggtools.grand.graph.LinkImpl
All Implemented Interfaces:
GraphObject, Link
Direct Known Subclasses:
AntLink

public class LinkImpl
extends AttributeManager
implements Link

Author:
Christophe Labouisse

Field Summary
 
Fields inherited from interface net.ggtools.grand.graph.Link
ATTR_CONDITIONAL_LINK, ATTR_WEAK_LINK
 
Fields inherited from interface net.ggtools.grand.graph.GraphObject
ATTR_ALL, ATTR_NONE
 
Constructor Summary
LinkImpl(java.lang.String name, Graph graph, Node startNode, Node endNode)
          Creates a new Link.
 
Method Summary
 void accept(LinkVisitor visitor)
          Accepts a visitor.
 Node getEndNode()
          Return the node located at the end of the link.
 Graph getGraph()
          Gets the owner graph of the object.
 java.lang.String getName()
          Gets the object's name.
 Node getStartNode()
          Return the node located at the start of the link.
 java.lang.String toString()
           
 
Methods inherited from class net.ggtools.grand.graph.AttributeManager
clearAttributes, getAttributes, hasAttributes, setAttributes
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface net.ggtools.grand.graph.GraphObject
clearAttributes, getAttributes, hasAttributes, setAttributes
 

Constructor Detail

LinkImpl

public LinkImpl(java.lang.String name,
                Graph graph,
                Node startNode,
                Node endNode)
Creates a new Link.

Parameters:
name - link's name, may be null.
graph - owning graph.
startNode - start node of the link
endNode - link's end node.
Method Detail

toString

public java.lang.String toString()
Overrides:
toString in class java.lang.Object

getStartNode

public Node getStartNode()
Description copied from interface: Link
Return the node located at the start of the link.

Specified by:
getStartNode in interface Link
Returns:
start node

getEndNode

public Node getEndNode()
Description copied from interface: Link
Return the node located at the end of the link.

Specified by:
getEndNode in interface Link
Returns:
end node

getGraph

public Graph getGraph()
Description copied from interface: GraphObject
Gets the owner graph of the object.

Specified by:
getGraph in interface GraphObject
Returns:
the owning graph.

getName

public java.lang.String getName()
Description copied from interface: GraphObject
Gets the object's name.

Specified by:
getName in interface GraphObject
Returns:
object's name.

accept

public void accept(LinkVisitor visitor)
Description copied from interface: Link
Accepts a visitor. The implementation must call the appropriate visitLink method.

Specified by:
accept in interface Link


Copyright © 2004-2005 ggTools. All Rights Reserved.