SandMark version 3.0


sandmark.util.graph
Class Edge

java.lang.Object
  |
  +--sandmark.util.graph.Edge
All Implemented Interfaces:
java.lang.Cloneable
Direct Known Subclasses:
Dot.MyEdge, Edge

public class Edge
extends java.lang.Object
implements java.lang.Cloneable

Operations on edgess belonging to a sandmark.util.graph.Graph.


Field Summary
static int BACK
           
(package private)  int Class
           
(package private) static java.lang.String[] classNames
           
static int CROSS
           
(package private)  java.lang.String[] edgeColors
           
static int FORWARD
           
static int NO_EDGE_NUMBER
           
static int NOCLASS
           
protected  Node sink
           
protected  Node source
           
protected  int theEdgeNumber
           
static int TREE
           
 
Constructor Summary
Edge(Node source, Node sink)
           
Edge(Node source, Node sink, int theEdgeNumber)
           
Edge(Node source, Node sink, int theEdgeNumber, int edgeClass)
           
 
Method Summary
static java.lang.String classToString(int c)
           
 java.lang.Object clone()
           
protected  java.lang.String color()
          Return the color of this edge.
 int edgeClass()
           
 int edgeNumber()
           
 boolean equals(java.lang.Object e)
           
protected  int fontsize()
          Return the fontsize of this edge.
 Node getSink()
           
 Node getSource()
           
 int hashCode()
           
static void main(java.lang.String[] args)
           
 java.lang.String name(Graph graph)
           
protected  java.lang.String orientation()
          Return the orientation of this edge.
 void setEdgeClass(int Class)
           
 void setEdgeNumber(int theEdgeNumber)
           
 Node sinkNode()
           
 Node sourceNode()
           
protected  java.lang.String style()
          Return the style of this edge.
 java.lang.String toDot()
          Format the edge in the dot format.
 java.lang.String toDot(java.lang.String label)
          Format the edge in the dot format.
 java.lang.String toString()
           
 
Methods inherited from class java.lang.Object
finalize, getClass, notify, notifyAll, wait, wait, wait
 

Field Detail

theEdgeNumber

protected int theEdgeNumber

source

protected Node source

sink

protected Node sink

Class

int Class

NO_EDGE_NUMBER

public static final int NO_EDGE_NUMBER
See Also:
Constant Field Values

NOCLASS

public static final int NOCLASS
See Also:
Constant Field Values

TREE

public static final int TREE
See Also:
Constant Field Values

BACK

public static final int BACK
See Also:
Constant Field Values

FORWARD

public static final int FORWARD
See Also:
Constant Field Values

CROSS

public static final int CROSS
See Also:
Constant Field Values

classNames

static java.lang.String[] classNames

edgeColors

java.lang.String[] edgeColors
Constructor Detail

Edge

public Edge(Node source,
            Node sink,
            int theEdgeNumber)

Edge

public Edge(Node source,
            Node sink,
            int theEdgeNumber,
            int edgeClass)

Edge

public Edge(Node source,
            Node sink)
Method Detail

clone

public java.lang.Object clone()
                       throws java.lang.CloneNotSupportedException
Overrides:
clone in class java.lang.Object
java.lang.CloneNotSupportedException

getSource

public Node getSource()

getSink

public Node getSink()

edgeNumber

public int edgeNumber()

setEdgeNumber

public void setEdgeNumber(int theEdgeNumber)

sourceNode

public Node sourceNode()

sinkNode

public Node sinkNode()

edgeClass

public int edgeClass()

setEdgeClass

public void setEdgeClass(int Class)

name

public java.lang.String name(Graph graph)

equals

public boolean equals(java.lang.Object e)
Overrides:
equals in class java.lang.Object

hashCode

public int hashCode()
Overrides:
hashCode in class java.lang.Object

toString

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

classToString

public static java.lang.String classToString(int c)

toDot

public java.lang.String toDot(java.lang.String label)
Format the edge in the dot format.


color

protected java.lang.String color()
Return the color of this edge. Used when generating code for dot. Default is to color the edges based on their dfs traversal: TREE=BLACK, BACK=RED, FORWARD=BLUE, CROSS=MAGENTA.


style

protected java.lang.String style()
Return the style of this edge. Used when generating code for dot. Default is record.


orientation

protected java.lang.String orientation()
Return the orientation of this edge. Used when generating code for dot. sandmark.util.graph.Graph construct oriented graphs, i.e. each outgoing edge from a node is numbered. Default behavior is to print this number at the tail end of the edge.


fontsize

protected int fontsize()
Return the fontsize of this edge. Used when generating code for dot. Default is 10.


toDot

public java.lang.String toDot()
Format the edge in the dot format. This method should typically be overridden in order to format the edge label:
    public String toDot() {
       return toDot(data);
    }
 


main

public static void main(java.lang.String[] args)

SandMark version 3.0

Wed Jan 29 10:30:05 MST 2003