KickJava   Java API By Example, From Geeks To Geeks.

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


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.ObjectBase;
30 import java.util.ArrayList JavaDoc;
31
32 /**
33  * This is a base class for java Objects.
34  *
35  * @author <a HREF="mailto:Christophe.Demarey@lifl.fr">Christophe Demarey</A>
36  */

37
38 public class ObjectBaseImpl
39   implements ObjectBase
40 {
41     // ==================================================================
42
//
43
// Internal state.
44
//
45
// ==================================================================
46

47     /** Associated comments */
48     private ArrayList JavaDoc comments_;
49
50     /** The name */
51     private String JavaDoc name_;
52
53     /** The modifier */
54     private ModifierKindImpl modifier_;
55
56     /** Is this object final ? */
57     private boolean final_;
58
59     // ==================================================================
60
//
61
// Constructor.
62
//
63
// ==================================================================
64

65     /** The default constructor. */
66     public
67     ObjectBaseImpl()
68     {
69         // Init internal states
70
comments_ = new ArrayList JavaDoc();
71         name_ = null;
72         modifier_ = ModifierKindImpl.mk_public;
73         final_ = false;
74     }
75
76     // ==================================================================
77
//
78
// Internal methods.
79
//
80
// ==================================================================
81

82     // ==================================================================
83
//
84
// Public methods.
85
//
86
// ==================================================================
87

88     /**
89      * Add a comment.
90      *
91      * @param comment - The comment to add.
92      */

93     public void
94     addComment(String JavaDoc comment)
95     {
96         comments_.add(comment);
97     }
98
99     /**
100      * Get all comments.
101      *
102      * @return The list of comments.
103      */

104     public ArrayList JavaDoc
105     getComments()
106     {
107         return comments_;
108     }
109
110     /**
111      * Set its name.
112      *
113      * @param name - The name to set.
114      */

115     public void
116     setName(String JavaDoc name)
117     {
118         name_ = name;
119     }
120
121     /**
122      * Obtain its name.
123      *
124      * @return Its name.
125      */

126     public String JavaDoc
127     getName()
128     {
129         return name_;
130     }
131
132     /**
133      * Set its modifier.
134      *
135      * @param mk - The modifier to set.
136      */

137     public void
138     setModifier(ModifierKindImpl mk)
139     {
140         modifier_ = mk;
141     }
142
143     /**
144      * Obtain its modifier.
145      *
146      * @return Its modifier.
147      */

148     public ModifierKindImpl
149     getModifier()
150     {
151         return modifier_;
152     }
153
154     /**
155      * Set final this object.
156      *
157      * @param b - The value to set.
158      */

159     public void
160     setFinal(boolean b)
161     {
162         final_ = b;
163     }
164
165     /**
166      * Is this object final ?
167      *
168      * @return True if it is final, else false.
169      */

170     public boolean
171     isFinal()
172     {
173         return final_;
174     }
175 }
176
Popular Tags