KickJava   Java API By Example, From Geeks To Geeks.

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


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 /**
30  * TypeRefWithLengthImpl is a wrapper for IDL type references with an
31  * associated length, i.e. string, sequence, array, and wstring types.
32  *
33  * @author <a HREF="mailto:Philippe.Merle@lifl.fr">Philippe Merle</a>
34  * <a HREF="mailto:Mathieu.Vadet@lifl.fr">Mathieu Vadet</a>
35  *
36  * @version 0.1
37  */

38
39 public class TypeRefWithLengthImpl
40        extends TypeRefImpl
41        implements org.objectweb.openccm.ast.api.TypeRefWithLength
42 {
43     // ==================================================================
44
//
45
// Internal state.
46
//
47
// ==================================================================
48

49     /** Associated length for string, sequence, array, and wstring types. */
50     private int length_;
51
52     // ==================================================================
53
//
54
// Constructor.
55
//
56
// ==================================================================
57

58     /**
59      * The constructor.
60      *
61      * @param type The IDLType that should be referenced.
62      * @param kind The associated type kind.
63      * @param length The associated length.
64      */

65     protected
66     TypeRefWithLengthImpl(org.omg.CORBA.IDLType JavaDoc type,
67                           org.objectweb.openccm.ast.api.TypeKind kind,
68                           int length)
69     {
70         // Call the TypeRefImpl constructor.
71
super(type, kind);
72
73         // Init internal state.
74
length_ = length;
75     }
76
77     // ==================================================================
78
//
79
// Internal methods.
80
//
81
// ==================================================================
82

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

89     // ==================================================================
90
//
91
// Methods for OMG IDL org.objectweb.openccm.ast.api.TypeRefWithLength
92
//
93
// ==================================================================
94

95     /**
96      * Set the associated length.
97      *
98      * @param length The associated length.
99      */

100     public void
101     setLength(int length)
102     {
103         length_ = length;
104     }
105
106     /**
107      * Obtain the associated length.
108      *
109      * @return The associated length.
110      */

111     public int
112     getLength()
113     {
114         return length_;
115     }
116 }
117
Popular Tags