KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > samples > callgraph > MethodEdge


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 JavaDoc methodString;
8
9     public MethodEdge(Vertex sourceVertex, Vertex sinkVertex) {
10         super(sourceVertex, sinkVertex);
11         methodString = new StringBuffer JavaDoc();
12     }
13
14     public String JavaDoc getName() {
15         return toString();
16     }
17     
18     public void addMethodCall(String JavaDoc 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 JavaDoc toString() {
29         return methodString.toString();
30     }
31 }
32
Popular Tags