1 package samples.callgraph; 2 3 import salvo.jesus.graph.DirectedEdgeImpl; 4 import salvo.jesus.graph.Vertex; 5 6 public class MethodEdge extends DirectedEdgeImpl { 7 private StringBuffer methodString; 8 9 public MethodEdge(Vertex sourceVertex, Vertex sinkVertex) { 10 super(sourceVertex, sinkVertex); 11 methodString = new StringBuffer (); 12 } 13 14 public String getName() { 15 return toString(); 16 } 17 18 public void addMethodCall(String methodName, int count) { 19 if (methodString.length() > 0) { 20 methodString.append(", "); 21 } 22 23 methodString.append(count); 24 methodString.append(". "); 25 methodString.append(methodName); 26 } 27 28 public String toString() { 29 return methodString.toString(); 30 } 31 } 32 | Popular Tags |