net.sourceforge.fluxion.graph
Class AbstractEdge

java.lang.Object
  extended by net.sourceforge.fluxion.graph.AbstractEdge
All Implemented Interfaces:
Edge
Direct Known Subclasses:
IsAEdge, NestedEdge, ValueEdge, WalkEdge

public abstract class AbstractEdge
extends java.lang.Object
implements Edge

An abstract implementation of Edge which provides common implementations os the setter and getter methods defined by this interface. Unless you have a specific reason to, it is best to subclass this class and use the standard implementations when defining a new Edge instead of implementing Edge directly. Using this approach, all that is needed is to define how the new Edge handles owl properties.

Version:
0.1
Author:
Tony Burdett

Constructor Summary
AbstractEdge()
           
 
Method Summary
 void accept(EdgeVisitor visitor)
           
 Node getHeadNode()
          Return the Node at the head of this Edge.
 java.lang.String getLabel()
          A String to use as the label for this Edge when drawn on the graph.
 Node getTailNode()
          Return the Node at the tail of this Edge.
 void setHeadNode(Node head)
          Set the Node at the head of this Edge.
 void setLabel(java.lang.String label)
          Sets the String to use as a label.
 void setTailNode(Node tail)
          Set the Node at the tail of this Edge.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

AbstractEdge

public AbstractEdge()
Method Detail

setLabel

public void setLabel(java.lang.String label)
Description copied from interface: Edge
Sets the String to use as a label. This is optional, and is used for clarity when drawing the graph illustration only.

Specified by:
setLabel in interface Edge
Parameters:
label - the label on this edge

getLabel

public java.lang.String getLabel()
Description copied from interface: Edge
A String to use as the label for this Edge when drawn on the graph.

Specified by:
getLabel in interface Edge
Returns:
the label

setHeadNode

public void setHeadNode(Node head)
Description copied from interface: Edge
Set the Node at the head of this Edge. This method is very important for describing the structure of the graph. Nodes can be freely added to the graph, as can edges, but without careful sturcturing of ehad and tail nodes on an edge the graph will have no sensible structure.

Specified by:
setHeadNode in interface Edge
Parameters:
head - the node at the head of this edge

getHeadNode

public Node getHeadNode()
Description copied from interface: Edge
Return the Node at the head of this Edge.

Specified by:
getHeadNode in interface Edge
Returns:
the head node

setTailNode

public void setTailNode(Node tail)
Description copied from interface: Edge
Set the Node at the tail of this Edge. This method is very important for describing the structure of the graph. Nodes can be freely added to the graph, as can edges, but without careful sturcturing of ehad and tail nodes on an edge the graph will have no sensible structure.

Specified by:
setTailNode in interface Edge
Parameters:
tail - the node at the tail of this edge

getTailNode

public Node getTailNode()
Description copied from interface: Edge
Return the Node at the tail of this Edge.

Specified by:
getTailNode in interface Edge
Returns:
the tail node

accept

public void accept(EdgeVisitor visitor)
Specified by:
accept in interface Edge


Copyright © 2010. All Rights Reserved.