junit.quilt.cover.generic
Class EdgeFactoryImpl

java.lang.Object
  |
  +--junit.quilt.cover.generic.EdgeFactoryImpl
All Implemented Interfaces:
EdgeFactory

public class EdgeFactoryImpl
extends java.lang.Object
implements EdgeFactory


Constructor Summary
EdgeFactoryImpl()
           
 
Method Summary
 BlockVertex makeBlockVertex(org.apache.bcel.classfile.LineNumberTable lineNumberTable)
          makeBlockVertex() Override this method if you want to provide a special implementation of a block vertex.
 FlowControlEdge makeBranchEdge(BlockVertex source, BlockVertex target, java.lang.String branch, boolean value)
          makeBranchEdge() Override this if you want to have a specific Branch FlowControlEdge in your graph.
 FlowControlEdge makeDummyEdge(BlockVertex source, BlockVertex target)
          makeDummyEdge This is used to add a dummy edge into the graph.
 FinallyVertex makeEndVertex()
          makeEndVertex This will create a single exit point from the graph.
 FlowControlEdge makeExceptionEdge(BlockVertex source, BlockVertex handler, java.lang.Class exception)
          makeExceptionEdge() Override this method if you want to make a special exception edge.
 FlowControlEdge makeExceptionEdge(BlockVertex source, BlockVertex handler, org.apache.bcel.generic.ObjectType exception)
           
 FlowControlEdge makeExceptionEdge(BlockVertex source, java.lang.Class exception)
           
 FlowControlEdge makeExceptionEdge(BlockVertex source, org.apache.bcel.generic.ObjectType exception)
           
 FlowControlEdge makeJSREdge(BlockVertex source, BlockVertex target)
          Create an edge for JSR to a subroutine.
 FlowControlEdge makeNormalEdge(BlockVertex source, BlockVertex target)
          makeNormalEdge() Override this method if you want to make a special normal edge.
 FlowControlEdge makeReturnEdge(BlockVertex ret)
          makeReturnEdge This is called when a Return statement happens.
 FlowControlEdge makeSelectEdge(BlockVertex source, BlockVertex target, java.lang.String expr)
           
 FlowControlEdge makeSelectEdge(BlockVertex source, BlockVertex target, java.lang.String expr, int value)
          makeSelectEdge Override this method if you want to make a custom SelectEdge.
 InitVertex makeStartVertex()
          makeStartVertex This will create a new vertex which acts as the entry point into the method.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

EdgeFactoryImpl

public EdgeFactoryImpl()
Method Detail

makeBranchEdge

public FlowControlEdge makeBranchEdge(BlockVertex source,
                                      BlockVertex target,
                                      java.lang.String branch,
                                      boolean value)
makeBranchEdge() Override this if you want to have a specific Branch FlowControlEdge in your graph.
Specified by:
makeBranchEdge in interface EdgeFactory
Parameters:
source - is the BlockVertex which contains the branch statement.
target - is the target BlockVertex of the branch.
branch - will contain as much of a description of the branch we can get. (i.e. "a < 0")
value - is the required value the condition needs to evaluate to to execute this branch edge.

makeSelectEdge

public FlowControlEdge makeSelectEdge(BlockVertex source,
                                      BlockVertex target,
                                      java.lang.String expr,
                                      int value)
makeSelectEdge Override this method if you want to make a custom SelectEdge.
Specified by:
makeSelectEdge in interface EdgeFactory
Parameters:
source - is the BlockVertex which contains the Select statement.
target - is the BlockVertex which is targeted by the Select statement.
expr - is the expression which is evaluated for the switch statement. (i.e. "a + b")
value - is the integer value which is required in order to execute this branch. (The second version, without the "value" param is called for the default value.

makeSelectEdge

public FlowControlEdge makeSelectEdge(BlockVertex source,
                                      BlockVertex target,
                                      java.lang.String expr)
Specified by:
makeSelectEdge in interface EdgeFactory

makeExceptionEdge

public FlowControlEdge makeExceptionEdge(BlockVertex source,
                                         BlockVertex handler,
                                         java.lang.Class exception)
makeExceptionEdge() Override this method if you want to make a special exception edge.
Specified by:
makeExceptionEdge in interface EdgeFactory
Parameters:
source - is the BlockVertex which contains the exception thrower.
handler - is the BlockVertex which acts as this exception handler.
exceptions - is the set of exceptions which are caught by the exception handler. In the second variation, without the handler, it represents an unhandled exception.

makeExceptionEdge

public FlowControlEdge makeExceptionEdge(BlockVertex source,
                                         BlockVertex handler,
                                         org.apache.bcel.generic.ObjectType exception)
Specified by:
makeExceptionEdge in interface EdgeFactory

makeExceptionEdge

public FlowControlEdge makeExceptionEdge(BlockVertex source,
                                         java.lang.Class exception)
Specified by:
makeExceptionEdge in interface EdgeFactory

makeExceptionEdge

public FlowControlEdge makeExceptionEdge(BlockVertex source,
                                         org.apache.bcel.generic.ObjectType exception)
Specified by:
makeExceptionEdge in interface EdgeFactory

makeNormalEdge

public FlowControlEdge makeNormalEdge(BlockVertex source,
                                      BlockVertex target)
makeNormalEdge() Override this method if you want to make a special normal edge. A Normal Edge is used when there is only normal flow of control. (No branching or exceptions.) Just because you have a normal edge though, does not mean that the source and target fall under the same basic block. This edge may very well be a target from a previous branch.
Specified by:
makeNormalEdge in interface EdgeFactory
Parameters:
source - is the first BlockVertex in sequence.
target - is the second BlockVertex in sequence.

makeDummyEdge

public FlowControlEdge makeDummyEdge(BlockVertex source,
                                     BlockVertex target)
Description copied from interface: EdgeFactory
makeDummyEdge This is used to add a dummy edge into the graph. It will never make it into Bytecode.
Specified by:
makeDummyEdge in interface EdgeFactory

makeJSREdge

public FlowControlEdge makeJSREdge(BlockVertex source,
                                   BlockVertex target)
Create an edge for JSR to a subroutine.
Specified by:
makeJSREdge in interface EdgeFactory

makeReturnEdge

public FlowControlEdge makeReturnEdge(BlockVertex ret)
makeReturnEdge This is called when a Return statement happens.
Specified by:
makeReturnEdge in interface EdgeFactory
Parameters:
source - is the BlockVertex which contains the return.

makeBlockVertex

public BlockVertex makeBlockVertex(org.apache.bcel.classfile.LineNumberTable lineNumberTable)
makeBlockVertex() Override this method if you want to provide a special implementation of a block vertex. A BlockVertex represents a collection of OpCodes which have no branches or exceptions in them. (Except for the last member of the BlockVertex.
Specified by:
makeBlockVertex in interface EdgeFactory
Parameters:
lineNumberTable - is the line number table for the method. It can use this to determine which lines the block includes. It may be NULL. A BlockVertex is responsible for holding all of the instruction handles in the graph.

makeStartVertex

public InitVertex makeStartVertex()
makeStartVertex This will create a new vertex which acts as the entry point into the method. This gives a location for initialization code.
Specified by:
makeStartVertex in interface EdgeFactory

makeEndVertex

public FinallyVertex makeEndVertex()
makeEndVertex This will create a single exit point from the graph. This will help us in adding a finally statement, I believe.
Specified by:
makeEndVertex in interface EdgeFactory


Copyright © 2001-2002 David Dixon-Peugh. All Rights Reserved.