edu.uci.eecs.doc.cascade.graph
Class VertexLabelProvider

java.lang.Object
  extended by edu.uci.eecs.doc.cascade.graph.VertexLabelProvider
All Implemented Interfaces:
VertexNameProvider<Vertex>

public class VertexLabelProvider
extends Object
implements VertexNameProvider<Vertex>

Generates descriptive labels for vertices in a control flow graph.

Author:
Trevor Harmon

Constructor Summary
VertexLabelProvider(VertexNameProvider<Vertex> idProvider)
          Creates a new VertexLabelProvider object using the given ID provider as a backup.
 
Method Summary
 String getVertexAsHTML(Vertex vertex)
          Returns an HTML representation of the vertex label,
 String getVertexName(Vertex vertex)
          Generates a label corresponding to the given vertex of a control flow graph.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

VertexLabelProvider

public VertexLabelProvider(VertexNameProvider<Vertex> idProvider)
Creates a new VertexLabelProvider object using the given ID provider as a backup.

Parameters:
idProvider - a provider of vertex IDs
Method Detail

getVertexName

public String getVertexName(Vertex vertex)
Generates a label corresponding to the given vertex of a control flow graph. The label includes the vertex ID, a string representation of the vertex, and, if showInstructions is enabled, a list of the vertex's bytecode instructions.

Specified by:
getVertexName in interface VertexNameProvider<Vertex>
Parameters:
vertex - a vertex in the control flow graph
Returns:
a descriptive label of the vertex

getVertexAsHTML

public String getVertexAsHTML(Vertex vertex)
Returns an HTML representation of the vertex label,

Parameters:
vertex - the vertex to be converted to HTML format
Returns:
a snippet of HTML code