org.jtool.jxplatform.graph
Class GraphEdge

java.lang.Object
  extended byorg.jtool.jxplatform.graph.GraphEdge
All Implemented Interfaces:
GraphEdgeSort, GraphElement
Direct Known Subclasses:
ControlFlow, Dependence

public class GraphEdge
extends java.lang.Object
implements GraphElement, GraphEdgeSort

An edge object of CFGs and PDGs.

Author:
Katsuhsa Maruyama

Field Summary
protected  GraphNode dst
          A destination node of this edge.
protected  int sort
          The sort of this edge which is selected from among GraphEdgeSort.
protected  GraphNode src
          A sourec node of this edge.
 
Fields inherited from interface org.jtool.jxplatform.graph.GraphEdgeSort
antiDependence, CDs, DDs, deforderDependence, defuseDependence, fallControlDependence, fallThroughFlow, falseControlDependence, falseControlFlow, flows, outputDependence, parameterFlow, parameterIn, parameterOut, trueControlDependence, trueControlFlow
 
Constructor Summary
protected GraphEdge()
          Creates a new, empty edge.
  GraphEdge(GraphNode src, GraphNode dst)
          Creates a new edge.
 
Method Summary
 boolean equals(GraphElement elem)
          Tests if this edge equals to a given edge.
 GraphNode getDstNode()
          Returns destination nodes of this edges.
 int getSort()
          Returns the sort of this edge.
 GraphNode getSrcNode()
          Returns source nodes of this edges.
 void print()
          Displays information about this node.
 void print(java.lang.StringBuffer buf)
          Collects information about this node for printing.
 void setDstNode(GraphNode node)
          Sets a destination node of this edge.
 void setSort(int sort)
          Sets the sort of this edge.
 void setSrcNode(GraphNode node)
          Sets a source node of this edge.
 void write(java.lang.StringBuffer buf)
          Collects information about this node for writing an XML document.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

src

protected GraphNode src
A sourec node of this edge.


dst

protected GraphNode dst
A destination node of this edge.


sort

protected int sort
The sort of this edge which is selected from among GraphEdgeSort.

Constructor Detail

GraphEdge

protected GraphEdge()
Creates a new, empty edge.


GraphEdge

public GraphEdge(GraphNode src,
                 GraphNode dst)
Creates a new edge.

Parameters:
src - A source node of this edge.
dst - A destination node of this edge.
Method Detail

equals

public boolean equals(GraphElement elem)
Tests if this edge equals to a given edge.

Specified by:
equals in interface GraphElement
Parameters:
elem - An edge to be checked.
Returns:
true if the edges are equal, otherwise false.

setSort

public void setSort(int sort)
Sets the sort of this edge.

Parameters:
sort - The sort of this edge.

getSort

public int getSort()
Returns the sort of this edge.

Returns:
The sort of this edge.

setSrcNode

public void setSrcNode(GraphNode node)
Sets a source node of this edge.

Parameters:
node - A source node.

setDstNode

public void setDstNode(GraphNode node)
Sets a destination node of this edge.

Parameters:
node - A destination node.

getSrcNode

public GraphNode getSrcNode()
Returns source nodes of this edges.

Returns:
The source nodes.

getDstNode

public GraphNode getDstNode()
Returns destination nodes of this edges.

Returns:
The destination nodes.

print

public void print()
Displays information about this node.

Specified by:
print in interface GraphElement

print

public void print(java.lang.StringBuffer buf)
Collects information about this node for printing.

Parameters:
buf - The information about the node.

write

public void write(java.lang.StringBuffer buf)
Collects information about this node for writing an XML document.

Parameters:
buf - The information about the node.