KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > soot > jimple > toolkits > annotation > callgraph > CallData


1 /* Soot - a J*va Optimization Framework
2  * Copyright (C) 2004 Jennifer Lhotak
3  *
4  * This library is free software; you can redistribute it and/or
5  * modify it under the terms of the GNU Lesser General Public
6  * License as published by the Free Software Foundation; either
7  * version 2.1 of the License, or (at your option) any later version.
8  *
9  * This library is distributed in the hope that it will be useful,
10  * but WITHOUT ANY WARRANTY; without even the implied warranty of
11  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
12  * Lesser General Public License for more details.
13  *
14  * You should have received a copy of the GNU Lesser General Public
15  * License along with this library; if not, write to the
16  * Free Software Foundation, Inc., 59 Temple Place - Suite 330,
17  * Boston, MA 02111-1307, USA.
18  */

19
20 package soot.jimple.toolkits.annotation.callgraph;
21
22 import java.util.*;
23
24 public class CallData {
25
26     private HashMap map = new HashMap();
27     private ArrayList children = new ArrayList();
28     private ArrayList outputs = new ArrayList();
29     private String JavaDoc data;
30
31     public String JavaDoc toString(){
32         StringBuffer JavaDoc sb = new StringBuffer JavaDoc();
33         sb.append("Data: ");
34         sb.append(data);
35         //sb.append(" Children: ");
36
//sb.append(children);
37
//sb.append(" Outputs: ");
38
//sb.append(outputs);
39
return sb.toString();
40     }
41     
42     public void addChild(CallData cd){
43         children.add(cd);
44     }
45
46     public void addOutput(CallData cd){
47         if (!outputs.contains(cd)){
48             outputs.add(cd);
49         }
50     }
51
52     public void setData(String JavaDoc d){
53         data = d;
54     }
55
56     public String JavaDoc getData(){
57         return data;
58     }
59
60     public ArrayList getChildren(){
61         return children;
62     }
63
64     public ArrayList getOutputs(){
65         return outputs;
66     }
67
68     public void addToMap(Object JavaDoc key, CallData val){
69         map.put(key, val);
70     }
71
72     public HashMap getMap(){
73         return map;
74     }
75
76 }
77
Popular Tags