KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > objectweb > openccm > generator > java > ast > lib > InterfaceObjectImpl


1 /*====================================================================
2
3 OpenCCM: The Open CORBA Component Model Platform
4 Copyright (C) 2000-2004 INRIA & USTL - LIFL - GOAL
5 Contact: openccm@objectweb.org
6
7 This library is free software; you can redistribute it and/or
8 modify it under the terms of the GNU Lesser General Public
9 License as published by the Free Software Foundation; either
10 version 2.1 of the License, or any later version.
11
12 This library is distributed in the hope that it will be useful,
13 but WITHOUT ANY WARRANTY; without even the implied warranty of
14 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
15 Lesser General Public License for more details.
16
17 You should have received a copy of the GNU Lesser General Public
18 License along with this library; if not, write to the Free Software
19 Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307
20 USA
21
22 Initial developer(s): Christophe Demarey.
23 Contributor(s): ________________________________________.
24
25 ====================================================================*/

26
27 package org.objectweb.openccm.generator.java.ast.lib;
28
29 import org.objectweb.openccm.generator.java.ast.api.AbstractObject;
30 import org.objectweb.openccm.generator.java.ast.api.InterfaceObject;
31 import org.objectweb.openccm.generator.java.ast.api.MethodObject;
32 import java.util.ArrayList JavaDoc;
33
34 /**
35  * This is the representation for java Interfaces.
36  *
37  * @author <a HREF="mailto:Christophe.Demarey@lifl.fr">Christophe Demarey</A>
38  */

39
40 public class InterfaceObjectImpl
41      extends ObjectWithPackageImpl
42   implements InterfaceObject
43 {
44     // ==================================================================
45
//
46
// Internal state.
47
//
48
// ==================================================================
49

50     /** The delegation for an abstract */
51     private AbstractObject abstract_delegate_;
52
53     /** Interface Methods */
54     private ArrayList JavaDoc methods_;
55
56     /** Interface import statements */
57     private ArrayList JavaDoc imports_;
58
59     /** Implemented objects */
60     private ArrayList JavaDoc inherited_objects_;
61
62     // ==================================================================
63
//
64
// Constructor.
65
//
66
// ==================================================================
67

68     /** The default constructor. */
69     public
70     InterfaceObjectImpl()
71     {
72         // Init internal states
73
super();
74         abstract_delegate_ = new AbstractObjectImpl();
75         methods_ = new ArrayList JavaDoc();
76         imports_ = new ArrayList JavaDoc();
77         inherited_objects_ = new ArrayList JavaDoc();
78     }
79
80     /**
81      * The constructor with the name.
82      *
83      * @param name - The name to set.
84      */

85     public
86     InterfaceObjectImpl(String JavaDoc name)
87     {
88         // Init internal states
89
super();
90         abstract_delegate_ = new AbstractObjectImpl();
91         methods_ = new ArrayList JavaDoc();
92         imports_ = new ArrayList JavaDoc();
93         inherited_objects_ = new ArrayList JavaDoc();
94
95         setName(name);
96     }
97     // ==================================================================
98
//
99
// Internal methods.
100
//
101
// ==================================================================
102

103     // ==================================================================
104
//
105
// Public methods.
106
//
107
// ==================================================================
108

109     // ==================================================================
110
//
111
// Methods for org.objectweb.openccm.generator.java.ast.api.AbstractObject
112
//
113
// ==================================================================
114

115     /**
116      * Set abstract this object.
117      *
118      * @param b - The value to set.
119      */

120     public void
121     setAbstract(boolean b)
122     {
123         abstract_delegate_.setAbstract(b);
124     }
125
126     /**
127      * Is this object abstract ?
128      *
129      * @return True if it is abstract, else false.
130      */

131     public boolean
132     isAbstract()
133     {
134         return abstract_delegate_.isAbstract();
135     }
136
137     // ==================================================================
138
//
139
// Methods for org.objectweb.openccm.generator.java.ast.api.InterfaceObject
140
//
141
// ==================================================================
142

143     /**
144      * Add an import statement.
145      *
146      * @param object - The object to add.
147      */

148     public void
149     addImport(String JavaDoc object)
150     {
151         imports_.add(object);
152     }
153
154     /**
155      * Obtain all import statements.
156      *
157      * @return A list of import statements.
158      */

159     public ArrayList JavaDoc
160     getImports()
161     {
162         return imports_;
163     }
164
165     /**
166      * Add an implemented object.
167      *
168      * @param object - The object to add.
169      */

170     public void
171     addInheritedObject(String JavaDoc object)
172     {
173         inherited_objects_.add(object);
174     }
175
176     /**
177      * Obtain all implemented objects.
178      *
179      * @return A list of implemented objects.
180      */

181     public ArrayList JavaDoc
182     getInheritedObjects()
183     {
184         return inherited_objects_;
185     }
186
187     /**
188      * Add a method.
189      *
190      * @param method - The method to add.
191      */

192     public void
193     addMethod(MethodObject method)
194     {
195         methods_.add(method);
196     }
197
198     /**
199      * Obtain all methods.
200      *
201      * @return A list of methods.
202      */

203     public ArrayList JavaDoc
204     getMethods()
205     {
206         return methods_;
207     }
208 }
209
Popular Tags