KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > ca > mcgill > sable > soot > callgraph > CallGraphNode


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
21 package ca.mcgill.sable.soot.callgraph;
22
23 import ca.mcgill.sable.graph.model.*;
24 import soot.*;
25
26 public class CallGraphNode extends SimpleNode {
27
28     private CallGraphGenerator generator;
29     private boolean expand = true;
30     private boolean expandCollape = false;
31     private boolean collapse = false;
32     
33     public boolean isLeaf(){
34         if ((getOutputs() == null) ||(getOutputs().size() == 0)) return true;
35         return false;
36     }
37
38     public CallGraphNode() {
39         super();
40     }
41     
42     public void setData(Object JavaDoc obj){
43         if (obj instanceof SootMethod){
44             data = obj;
45             firePropertyChange(DATA, obj);
46         }
47     }
48
49     /**
50      * @return
51      */

52     public CallGraphGenerator getGenerator() {
53         return generator;
54     }
55
56     /**
57      * @param generator
58      */

59     public void setGenerator(CallGraphGenerator generator) {
60         this.generator = generator;
61     }
62
63     /**
64      * @return
65      */

66     public boolean isExpand() {
67         return expand;
68     }
69
70     /**
71      * @param b
72      */

73     public void setExpand(boolean b) {
74         expand = b;
75     }
76
77     /**
78      * @return
79      */

80     public boolean isCollapse() {
81         return collapse;
82     }
83
84     /**
85      * @return
86      */

87     public boolean isExpandCollape() {
88         return expandCollape;
89     }
90
91     /**
92      * @param b
93      */

94     public void setCollapse(boolean b) {
95         collapse = b;
96     }
97
98     /**
99      * @param b
100      */

101     public void setExpandCollape(boolean b) {
102         expandCollape = b;
103     }
104
105 }
106
Popular Tags