org.quilt.cover.stmt
Class CounterVertex

java.lang.Object
  |
  +--org.quilt.graph.Vertex
        |
        +--org.quilt.cl.CodeVertex
              |
              +--org.quilt.cover.stmt.CounterVertex

public class CounterVertex
extends CodeVertex

A CodeVertex which carries counter instrumentation and a label. The counter has an index. Whenever the flow of execution passes through this vertex, the counter code adds 1 to the hit count table, to q$$q[n], where n is the counter index.

Counter indexes are unique and assigned consecutively. They are not the same as vertex indexes. In the current revision of the software, counter vertices are also labeled with the counter index.

Author:
Jim Dixon

Field Summary
 
Fields inherited from class org.quilt.cl.CodeVertex
connInst_, endLine_, ilist, pos, startLine_
 
Fields inherited from class org.quilt.graph.Vertex
connector, graph, index, label_
 
Constructor Summary
CounterVertex(ControlFlowGraph g)
          Create a code vertex with default bytecode offset, line number, empty instruction list, and no label.
CounterVertex(ControlFlowGraph g, java.lang.String lbl)
          Create a counter vertex, specifying a label
 
Method Summary
 java.lang.String toString()
          Less verbose toString.
 java.lang.String toString(boolean b)
          Optionally more verbose method.
 
Methods inherited from class org.quilt.cl.CodeVertex
getConnInst, getEndLine, getInstructionList, getPosition, getStartLine, moveGoto, setConnInst, setEndLine, setPos, setStartLine
 
Methods inherited from class org.quilt.graph.Vertex
above, checkForNull, getConnector, getEdge, getGraph, getIndex, getLabel, getTarget, makeBinary, makeComplex, makeMulti, setConnector, setLabel
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

CounterVertex

public CounterVertex(ControlFlowGraph g)
Create a code vertex with default bytecode offset, line number, empty instruction list, and no label.

Parameters:
g - Graph which the vertex belongs to.

CounterVertex

public CounterVertex(ControlFlowGraph g,
                     java.lang.String lbl)
Create a counter vertex, specifying a label

Parameters:
g - Graph which the vertex belongs to.
Method Detail

toString

public java.lang.String toString()
Description copied from class: CodeVertex
Less verbose toString.

Overrides:
toString in class CodeVertex
Returns:
Graph index and Vertex index in a neatly formatted String, including the label if there is one, *not* newline-terminated.

toString

public java.lang.String toString(boolean b)
Description copied from class: CodeVertex
Optionally more verbose method.

Overrides:
toString in class CodeVertex
Parameters:
b - If true, add label (if any) and instruction list.
Returns:
A neatly formatted String ending with a newline.


Copyright © 2001-2003 Apache Software Foundation. All Rights Reserved.