org.jtool.jxplatform.graph.cfg
Class ControlFlow

java.lang.Object
  extended byorg.jtool.jxplatform.graph.GraphEdge
      extended byorg.jtool.jxplatform.graph.cfg.ControlFlow
All Implemented Interfaces:
GraphEdgeSort, GraphElement

public class ControlFlow
extends GraphEdge

An edge (control flow) of CFGs.

Author:
Katsuhsa Maruyama

Field Summary
 
Fields inherited from class org.jtool.jxplatform.graph.GraphEdge
dst, sort, src
 
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 ControlFlow()
          Creates a new, empty object.
protected ControlFlow(CFGNode src, CFGNode dst)
          Creates a new edge.
 
Method Summary
 boolean equals(GraphElement elem)
          Tests if this edge equals to a given edge.
 boolean isFallThrough()
          Tests if this edge is the fall-through control flow.
 boolean isFalse()
          Tests if this edge is the false control flow.
 boolean isLoopBack()
          Tests if this edge is the loopback control flow.
 boolean isParameter()
          Tests if this edge is the parameter passing flow.
 boolean isTrue()
          Tests if this edge is the true control flow.
 void print()
          Displays information about this edge.
 void print(java.lang.StringBuffer buf)
          Collects information about this edge for printing.
 void setFallThrough()
          Sets as this edge is the fall-through control flow.
 void setFalse()
          Sets as this edge is the false control flow.
 void setLoopBack(boolean bool)
          Sets the flag of the loopback.
 void setParameter()
          Sets as this edge is the parameter passing flow.
 void setTrue()
          Sets as this edge is the true control flow.
 void write(java.lang.StringBuffer buf)
          Collects information about this edge for writing an XML document.
 
Methods inherited from class org.jtool.jxplatform.graph.GraphEdge
getDstNode, getSort, getSrcNode, setDstNode, setSort, setSrcNode
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ControlFlow

protected ControlFlow()
Creates a new, empty object.


ControlFlow

protected ControlFlow(CFGNode src,
                      CFGNode 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
Overrides:
equals in class GraphEdge
Parameters:
elem - A edge to be checked.
Returns:
true if the edges are equal, otherwise false.

setTrue

public void setTrue()
Sets as this edge is the true control flow.


isTrue

public boolean isTrue()
Tests if this edge is the true control flow.

Returns:
true if this edge is the true control flow, otherwise false.

setFalse

public void setFalse()
Sets as this edge is the false control flow.


isFalse

public boolean isFalse()
Tests if this edge is the false control flow.

Returns:
true if this edge is the false control flow, otherwise false.

setFallThrough

public void setFallThrough()
Sets as this edge is the fall-through control flow.


isFallThrough

public boolean isFallThrough()
Tests if this edge is the fall-through control flow.

Returns:
true if this edge is the fall-through control flow, otherwise false.

setParameter

public void setParameter()
Sets as this edge is the parameter passing flow.


isParameter

public boolean isParameter()
Tests if this edge is the parameter passing flow.

Returns:
true if this edge is the parameter passing flow, otherwise false.

setLoopBack

public void setLoopBack(boolean bool)
Sets the flag of the loopback.

Parameters:
bool - true if this edge is the loopback.

isLoopBack

public boolean isLoopBack()
Tests if this edge is the loopback control flow.

Returns:
true if this edge is the loopback control flow, otherwise false.

print

public void print()
Displays information about this edge.

Specified by:
print in interface GraphElement
Overrides:
print in class GraphEdge

print

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

Overrides:
print in class GraphEdge
Parameters:
buf - The information about the edge.

write

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

Overrides:
write in class GraphEdge
Parameters:
buf - The information about the edge.