1:
37:
38:
39: package ;
40:
41:
42: import ;
43: import ;
44: import ;
45:
46:
50: public class ArrayTypeCode
51: extends PrimitiveTypeCode
52: {
53:
56: private static final long serialVersionUID = 1;
57:
58:
59:
62: TypeCode of;
63:
64:
68: private int length;
69:
70:
77: public ArrayTypeCode(TCKind array_of)
78: {
79: super(TCKind.tk_sequence);
80: of = new PrimitiveTypeCode(array_of);
81: }
82:
83:
91: public ArrayTypeCode(TCKind this_type, TypeCode array_of)
92: {
93: super(this_type);
94: of = array_of;
95: }
96:
97:
102: public TypeCode content_type()
103: throws org.omg.CORBA.TypeCodePackage.BadKind
104: {
105: return of;
106: }
107:
108:
117: public boolean equal(TypeCode other)
118: {
119: try
120: {
121: return kind() == other.kind() &&
122: content_type() == other.content_type();
123: }
124: catch (BadKind ex)
125: {
126:
127: return false;
128: }
129: }
130:
131:
142: public String id()
143: throws org.omg.CORBA.TypeCodePackage.BadKind
144: {
145: switch (content_type().kind().value())
146: {
147: case TCKind._tk_null :
148: return "IDL:omg.org/CORBA/NullSeq:1.0";
149:
150: case TCKind._tk_void :
151: return "IDL:omg.org/CORBA/VoidSeq:1.0";
152:
153: case TCKind._tk_short :
154: return "IDL:omg.org/CORBA/ShortSeq:1.0";
155:
156: case TCKind._tk_long :
157: return "IDL:omg.org/CORBA/LongSeq:1.0";
158:
159: case TCKind._tk_ushort :
160: return "IDL:omg.org/CORBA/UShortSeq:1.0";
161:
162: case TCKind._tk_ulong :
163: return "IDL:omg.org/CORBA/ULongSeq:1.0";
164:
165: case TCKind._tk_float :
166: return "IDL:omg.org/CORBA/FloatSeq:1.0";
167:
168: case TCKind._tk_double :
169: return "IDL:omg.org/CORBA/DoubleSeq:1.0";
170:
171: case TCKind._tk_boolean :
172: return "IDL:omg.org/CORBA/BooleanSeq:1.0";
173:
174: case TCKind._tk_char :
175: return "IDL:omg.org/CORBA/CharSeq:1.0";
176:
177: case TCKind._tk_octet :
178: return "IDL:omg.org/CORBA/OctetSeq:1.0";
179:
180: case TCKind._tk_any :
181: return "IDL:omg.org/CORBA/AnySeq:1.0";
182:
183: case TCKind._tk_TypeCode :
184: return "IDL:omg.org/CORBA/TypeCodeSeq:1.0";
185:
186: case TCKind._tk_Principal :
187: return "IDL:omg.org/CORBA/PrincipalSeq:1.0";
188:
189: case TCKind._tk_objref :
190: return "IDL:omg.org/CORBA/ObjrefSeq:1.0";
191:
192: case TCKind._tk_struct :
193: return "IDL:omg.org/CORBA/StructSeq:1.0";
194:
195: case TCKind._tk_union :
196: return "IDL:omg.org/CORBA/UnionSeq:1.0";
197:
198: case TCKind._tk_enum :
199: return "IDL:omg.org/CORBA/EnumSeq:1.0";
200:
201: case TCKind._tk_string :
202: return "IDL:omg.org/CORBA/StringSeq:1.0";
203:
204: case TCKind._tk_sequence :
205: return "IDL:omg.org/CORBA/SequenceSeq:1.0";
206:
207: case TCKind._tk_array :
208: return "IDL:omg.org/CORBA/ArraySeq:1.0";
209:
210: case TCKind._tk_alias :
211: return "IDL:omg.org/CORBA/AliasSeq:1.0";
212:
213: case TCKind._tk_except :
214: return "IDL:omg.org/CORBA/ExceptSeq:1.0";
215:
216: case TCKind._tk_longlong :
217: return "IDL:omg.org/CORBA/LongLongSeq:1.0";
218:
219: case TCKind._tk_ulonglong :
220: return "IDL:omg.org/CORBA/ULongLongSeq:1.0";
221:
222: case TCKind._tk_longdouble :
223: return "IDL:omg.org/CORBA/LongDoubleSeq:1.0";
224:
225: case TCKind._tk_wchar :
226: return "IDL:omg.org/CORBA/WCharSeq:1.0";
227:
228: case TCKind._tk_wstring :
229: return "IDL:omg.org/CORBA/WStringSeq:1.0";
230:
231: case TCKind._tk_fixed :
232: return "IDL:omg.org/CORBA/FixedSeq:1.0";
233:
234: case TCKind._tk_value :
235: return "IDL:omg.org/CORBA/ValueSeq:1.0";
236:
237: case TCKind._tk_value_box :
238: return "IDL:omg.org/CORBA/Value_boxSeq:1.0";
239:
240: case TCKind._tk_native :
241: return "IDL:omg.org/CORBA/NativeSeq:1.0";
242:
243: case TCKind._tk_abstract_interface :
244: return "IDL:omg.org/CORBA/Abstract_interfaceSeq:1.0";
245:
246: default :
247: throw new BadKind();
248: }
249: }
250:
251:
256: public int length()
257: throws org.omg.CORBA.TypeCodePackage.BadKind
258: {
259: return length;
260: }
261:
262:
267: public void setLength(int l)
268: {
269: this.length = l;
270: }
271:
272: }