KickJava   Java API By Example, From Geeks To Geeks.

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


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.ast.lib;
28
29 /** Used to access AST TypeRef. */
30 import org.objectweb.openccm.ast.api.TypeRef;
31
32 /** Used to access AST StorageTypeBase. */
33 import org.objectweb.openccm.ast.api.StorageTypeBase;
34
35 /**
36  * PsdlTypeRefImpl is a wrapper for psdl and idl types.
37  *
38  * @author <a HREF="mailto:Christophe.Demarey@lifl.fr">Christophe Demarey</a>
39  *
40  * @version 0.1
41  */

42
43 public class PsdlTypeRefImpl
44        extends ObjectBase
45        implements org.objectweb.openccm.ast.api.PsdlTypeRef
46 {
47     // ==================================================================
48
//
49
// Internal state.
50
//
51
// ==================================================================
52

53     /** The storage type base wrapped */
54     protected StorageTypeBase psdl_type_;
55
56     /** The storage type wrapped */
57     protected TypeRef idl_type_;
58
59     /** Is this type a reference to an object ? */
60     protected boolean ref_;
61
62     /** Is this type a strong reference to an object ? */
63     protected boolean strong_;
64
65     // ==================================================================
66
//
67
// Constructor.
68
//
69
// ==================================================================
70

71     /**
72      * The constructor for idl types.
73      *
74      * @param idl_type - The IDLType that should be referenced.
75      */

76     protected
77     PsdlTypeRefImpl(TypeRef idl_type)
78     {
79         // init internal states
80
idl_type_ = idl_type;
81         psdl_type_ = null;
82         ref_ = false;
83         strong_ = false;
84     }
85
86     /**
87      * The constructor for psdl abstract storagetype.
88      *
89      * @param psdl_type - The abstract storagetype that should be referenced.
90      * @param ref - Is it a reference to a storagetype?
91      * @param strong - Is it a strong reference to a storagetype?
92      */

93     protected
94     PsdlTypeRefImpl(StorageTypeBase psdl_type, boolean ref, boolean strong)
95     {
96         // init internal states
97
idl_type_ = null;
98         psdl_type_ = psdl_type;
99         ref_ = ref;
100         strong_ = strong;
101     }
102
103     // ==================================================================
104
//
105
// Internal methods.
106
//
107
// ==================================================================
108

109     // ==================================================================
110
//
111
// Public methods.
112
//
113
// ==================================================================
114

115     // ==================================================================
116
//
117
// Methods for interface org.objectweb.openccm.ast.api.PsdlTypeRef
118
//
119
// ==================================================================
120

121     /**
122      * Obtain its StorageTypeBase reference.
123      *
124      * @return The StorageTypeBase associated with the type reference.
125      */

126     public StorageTypeBase
127     getStorageTypeBase()
128     {
129         return psdl_type_;
130     }
131
132     /**
133      * Obtain its idl type reference.
134      *
135      * @return The idl type reference associated with the type reference.
136      */

137     public TypeRef
138     getTypeRef()
139     {
140         return idl_type_;
141     }
142
143     /**
144      * Is this type a reference to a psdl object ?
145      *
146      * @return True if it is a reference, else false.
147      */

148     public boolean
149     isRef()
150     {
151         return ref_;
152     }
153
154     /**
155      * Is this type a strong reference to a psdl object ?
156      *
157      * @return True if it is a strong reference, else false.
158      */

159     public boolean
160     isStrong()
161     {
162         return strong_;
163     }
164
165 }
166
Popular Tags