KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > ca > mcgill > sable > soot > editors > JimpleOutlineObject


1 /* Soot - a J*va Optimization Framework
2  * Copyright (C) 2003 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.editors;
22
23 import java.util.*;
24
25 public class JimpleOutlineObject {
26
27     private Vector children;
28     private String JavaDoc label;
29     private JimpleOutlineObject parent;
30     private int type;
31     private BitSet decorators;
32     
33     public static final int NONE = 100;
34     public static final int CLASS = 10;
35     public static final int INTERFACE = 11;
36     public static final int METHOD = 1;
37     public static final int PUBLIC_METHOD = 2;
38     public static final int PRIVATE_METHOD = 3;
39     public static final int PROTECTED_METHOD = 4;
40     public static final int NONE_METHOD = 30;
41     public static final int FIELD = 5;
42     public static final int PUBLIC_FIELD = 6;
43     public static final int PRIVATE_FIELD = 7;
44     public static final int PROTECTED_FIELD = 8;
45     public static final int NONE_FIELD = 31;
46     
47     public static final int FINAL_DEC = 20;
48     public static final int STATIC_DEC = 21;
49     public static final int SYNCHRONIZED_DEC = 22;
50     public static final int ABSTRACT_DEC = 23;
51     
52     public JimpleOutlineObject(String JavaDoc label, int type, BitSet dec){
53         setLabel(label);
54         setType(type);
55         setDecorators(dec);
56     }
57     
58     public void addChild(JimpleOutlineObject t) {
59         if (getChildren() == null) {
60             setChildren(new Vector());
61         }
62         t.setParent(this);
63         getChildren().add(t);
64     }
65     
66     /**
67      * @return
68      */

69     public Vector getChildren() {
70         return children;
71     }
72
73     /**
74      * @return
75      */

76     public String JavaDoc getLabel() {
77         return label;
78     }
79
80     /**
81      * @return
82      */

83     public JimpleOutlineObject getParent() {
84         return parent;
85     }
86
87     /**
88      * @param vector
89      */

90     public void setChildren(Vector vector) {
91         children = vector;
92     }
93
94     /**
95      * @param string
96      */

97     public void setLabel(String JavaDoc string) {
98         label = string;
99     }
100
101     /**
102      * @param object
103      */

104     public void setParent(JimpleOutlineObject object) {
105         parent = object;
106     }
107
108     /**
109      * @return
110      */

111     public int getType() {
112         return type;
113     }
114
115     /**
116      * @param i
117      */

118     public void setType(int i) {
119         type = i;
120     }
121
122
123
124     /**
125      * @return
126      */

127     public BitSet getDecorators() {
128         return decorators;
129     }
130
131     /**
132      * @param list
133      */

134     public void setDecorators(BitSet list) {
135         decorators = list;
136     }
137
138 }
139
Popular Tags