KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > objectweb > openccm > ast > lib > WithNameTypeRefImpl


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): Philippe Merle, Mathieu Vadet.
23 Contributor(s): Christophe Demarey.
24
25 ====================================================================*/

26
27 package org.objectweb.openccm.ast.lib;
28
29 /** Used to reference an AST TypeRef. */
30 import org.objectweb.openccm.ast.api.TypeRef;
31
32 /**
33  * WithNameTypeRefImpl is a wrapper class for objects containing
34  * an associated name and type reference.
35  *
36  * Inherits from:
37  * - WithName for the associated name,
38  * - WithTypeRef for the associated type.
39  *
40  * @author <a HREF="mailto:Philippe.Merle@lifl.fr">Philippe Merle</a>
41  * <a HREF="mailto:Mathieu.Vadet@lifl.fr">Mathieu Vadet</a>
42  *
43  * @version 0.1
44  */

45
46 public class WithNameTypeRefImpl
47        extends WithNameImpl
48        implements org.objectweb.openccm.ast.api.WithNameTypeRef
49 {
50     // ==================================================================
51
//
52
// Internal state.
53
//
54
// ==================================================================
55

56     /** The associated type. */
57     protected TypeRef type_;
58
59     // ==================================================================
60
//
61
// Constructor.
62
//
63
// ==================================================================
64

65     /**
66      * The constructor.
67      *
68      * @param name The associated name.
69      * @param type The associated type.
70      */

71     public
72     WithNameTypeRefImpl(String JavaDoc name,
73                         TypeRef type)
74     {
75         // Call the WithNameImpl constructor.
76
super(name);
77
78         // Init internal state.
79
type_ = type;
80     }
81
82     // ==================================================================
83
//
84
// Internal methods.
85
//
86
// ==================================================================
87

88     // ==================================================================
89
//
90
// Public methods.
91
//
92
// ==================================================================
93

94     /**
95      * Obtain the associated CORBA::IDLType reference.
96      *
97      * @return The associated CORBA::IDLType reference.
98      */

99     public org.omg.CORBA.IDLType JavaDoc
100     getIDLType()
101     {
102         return ((IDLTypeWrapper)type_).getIDLType();
103     }
104
105     /**
106      * Obtain its associated CORBA::StructMember.
107      *
108      * @return Its associated CORBA::StructMember.
109      */

110     public org.omg.CORBA.StructMember JavaDoc
111     getStructMember()
112     {
113         return new org.omg.CORBA.StructMember JavaDoc(
114                        getName(),
115                        org.objectweb.openccm.corba.TypeCodeUtils.getTC_void(),
116                        getIDLType());
117     }
118
119     // ==================================================================
120
//
121
// Methods for OMG IDL org.objectweb.openccm.ast.api.WithNameTypeRef
122
//
123
// ==================================================================
124

125     /**
126      * Set the associated TypeRef reference.
127      *
128      * @param type The associated TypeRef reference.
129      */

130     public void
131     setType(TypeRef type)
132     {
133         type_ = type;
134     }
135
136     /**
137      * Obtain the associated TypeRef reference.
138      *
139      * @return The associated TypeRef reference.
140      */

141     public TypeRef
142     getType()
143     {
144         return type_;
145     }
146 }
147
Popular Tags