KickJava   Java API By Example, From Geeks To Geeks.

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


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.ClassObject;
30 import org.objectweb.openccm.generator.java.ast.api.ConstructorObject;
31 import org.objectweb.openccm.generator.java.ast.api.AttributeObject;
32 import java.util.ArrayList JavaDoc;
33
34 /**
35  * This is the representation for java Classes.
36  *
37  * @author <a HREF="mailto:Christophe.Demarey@lifl.fr">Christophe Demarey</A>
38  */

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

50     /** Implemented objects */
51     private ArrayList JavaDoc implemented_objects_;
52
53     /** Class constructors */
54     private ArrayList JavaDoc constructors_;
55
56     /** Class constructors */
57     private ArrayList JavaDoc attributes_;
58
59     // ==================================================================
60
//
61
// Constructor.
62
//
63
// ==================================================================
64

65     /** The default constructor. */
66     public
67     ClassObjectImpl()
68     {
69         // Init internal states
70
super();
71         implemented_objects_ = new ArrayList JavaDoc();
72         constructors_ = new ArrayList JavaDoc();
73         attributes_ = new ArrayList JavaDoc();
74     }
75
76     /**
77      * The constructor with the name.
78      *
79      * @param name - The name to set.
80      */

81     public
82     ClassObjectImpl(String JavaDoc name)
83     {
84         // Init internal states
85
super();
86         implemented_objects_ = new ArrayList JavaDoc();
87         constructors_ = new ArrayList JavaDoc();
88         attributes_ = new ArrayList JavaDoc();
89
90         setName(name);
91     }
92
93     // ==================================================================
94
//
95
// Internal methods.
96
//
97
// ==================================================================
98

99     // ==================================================================
100
//
101
// Public methods.
102
//
103
// ==================================================================
104

105     // ==================================================================
106
//
107
// Methods for org.objectweb.openccm.generator.java.ast.api.ClassObject
108
//
109
// ==================================================================
110

111     /**
112      * Add an implemented object.
113      *
114      * @param object - The object to add.
115      */

116     public void
117     addImplementedObject(String JavaDoc object)
118     {
119         implemented_objects_.add(object);
120     }
121
122     /**
123      * Obtain all implemented objects.
124      *
125      * @return A list of implemented objects.
126      */

127     public ArrayList JavaDoc
128     getImplementedObjects()
129     {
130         return implemented_objects_;
131     }
132
133     /**
134      * Add a constructor.
135      *
136      * @param constr - The constructor to add.
137      */

138     public void
139     addConstructor(ConstructorObject constr)
140     {
141         constructors_.add(constr);
142     }
143
144     /**
145      * Obtain all constructors.
146      *
147      * @return A list of constructors.
148      */

149     public ArrayList JavaDoc
150     getConstructors()
151     {
152         return constructors_;
153     }
154
155     /**
156      * Add an attribute.
157      *
158      * @param object - The attribute to add.
159      */

160     public void
161     addAttribute(AttributeObject att)
162     {
163         attributes_.add(att);
164     }
165
166     /**
167      * Obtain all attributes.
168      *
169      * @return A list of attributes.
170      */

171     public ArrayList JavaDoc
172     getAttributes()
173     {
174         return attributes_;
175     }
176 }
177
Popular Tags