byucc.jhdl.synth.graph
Class Edge

java.lang.Object
  extended bybyucc.jhdl.synth.graph.Edge
Direct Known Subclasses:
CFEdge, DFEdge

public class Edge
extends java.lang.Object

Represents a directed edge in a graph. This simple data structure only contains the head and tail of an edge. Users may want to subclass this object to provide an Edge with properites (i.e. weights, etc.).

Author:
Mike Wirthlin and Carl Worth

Field Summary
protected  Vertex head
           
protected  Vertex tail
           
 
Constructor Summary
Edge(Vertex t, Vertex h)
          Construct a new directed edge from tail -> head.
 
Method Summary
protected  java.lang.String edgeDotLabels()
           
protected  java.lang.String edgeDotProperties()
           
 boolean equals(java.lang.Object obj)
          Overrides Object.equals to determine if two edges are equal.
 Vertex getHead()
          Get the head of this edge.
 Vertex getTail()
          Get the tail of this edge.
 void setHead(Vertex h)
          Change this edge to point to the given vertex instead.
 void setProperty(java.lang.String key, java.lang.String value)
           
 void setTail(Vertex t)
          Change this edge to point from the given vertex instead.
 java.lang.String toDot()
          Get a String representation of the current edge in Dot file format.
 java.lang.String toString()
          Get a String representation of the current edge.
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

head

protected Vertex head

tail

protected Vertex tail
Constructor Detail

Edge

public Edge(Vertex t,
            Vertex h)
Construct a new directed edge from tail -> head.

Parameters:
t - The vertex that is the tail of the new edge, (the vertex from which the edge leaves).
h - The vertex that is the head of the new edge, (the vertex to which the edge points).
Method Detail

getHead

public Vertex getHead()
Get the head of this edge. Returns the vertex to which this edge points.

Returns:
the Vertex to which this edge points

getTail

public Vertex getTail()
Get the tail of this edge. Returns the vertex from which this edge leaves.

Returns:
the Vertex from which this edge leaves

setHead

public void setHead(Vertex h)
Change this edge to point to the given vertex instead.

Parameters:
h - the new head Vertex at which this Edge should point.

setTail

public void setTail(Vertex t)
Change this edge to point from the given vertex instead.

Parameters:
t - the new tail Vertex from which this Edge should point.

equals

public boolean equals(java.lang.Object obj)
Overrides Object.equals to determine if two edges are equal. Two Edges are equal iff they have the same head Vertex and the same tail Vertex. The actual pointers to the Edge objects need not be the same.

Parameters:
obj - an object, (likely an Edge object)
Returns:
true if obj is an Edge and both obj and this Edge have the same head and the same tail, false otherwise

edgeDotProperties

protected java.lang.String edgeDotProperties()

edgeDotLabels

protected java.lang.String edgeDotLabels()

setProperty

public void setProperty(java.lang.String key,
                        java.lang.String value)

toDot

public final java.lang.String toDot()
Get a String representation of the current edge in Dot file format.


toString

public java.lang.String toString()
Get a String representation of the current edge. Currently it simply returns a String version of toDot.

Returns:
a String representing this Edge


Copyright ? 2006 Brigham Young University, Configurable Computing Laboratory. All Rights Reserved.