Remove old autovect-branch by moving to "dead" directory.
[official-gcc.git] / old-autovect-branch / libjava / classpath / org / omg / CORBA / Any.java
blob1e72709d202e698f37de060c0c3e9ea15c62f596
1 /* Any.java --
2 Copyright (C) 2005 Free Software Foundation, Inc.
4 This file is part of GNU Classpath.
6 GNU Classpath is free software; you can redistribute it and/or modify
7 it under the terms of the GNU General Public License as published by
8 the Free Software Foundation; either version 2, or (at your option)
9 any later version.
11 GNU Classpath is distributed in the hope that it will be useful, but
12 WITHOUT ANY WARRANTY; without even the implied warranty of
13 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
14 General Public License for more details.
16 You should have received a copy of the GNU General Public License
17 along with GNU Classpath; see the file COPYING. If not, write to the
18 Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
19 02110-1301 USA.
21 Linking this library statically or dynamically with other modules is
22 making a combined work based on this library. Thus, the terms and
23 conditions of the GNU General Public License cover the whole
24 combination.
26 As a special exception, the copyright holders of this library give you
27 permission to link this library with independent modules to produce an
28 executable, regardless of the license terms of these independent
29 modules, and to copy and distribute the resulting executable under
30 terms of your choice, provided that you also meet, for each linked
31 independent module, the terms and conditions of the license of that
32 module. An independent module is a module which is not derived from
33 or based on this library. If you modify this library, you may extend
34 this exception to your version of the library, but you are not
35 obligated to do so. If you do not wish to do so, delete this
36 exception statement from your version. */
39 package org.omg.CORBA;
41 import java.io.Serializable;
43 import org.omg.CORBA.portable.IDLEntity;
45 /**
46 * A container that can store a value of either user defined or
47 * primitive IDL type.
49 * @author Audrius Meskauskas (AudriusA@Bioinformatics.org)
51 public abstract class Any
52 implements Serializable, IDLEntity
54 /**
55 * Using v 1.4 serialVersionUID for interoperability.
57 private static final long serialVersionUID = 1217179597823814463L;
59 /**
60 * Creates an input stream from that this Any object's value can be
61 * read (unmarshalled).
63 public abstract org.omg.CORBA.portable.InputStream create_input_stream();
65 /**
66 * Creates an output stream into which this <code>Any</code> object's
67 * value can be written (marshalled).
69 * @return the newly created output stream.
71 public abstract org.omg.CORBA.portable.OutputStream create_output_stream();
73 /**
74 * Compare this <code>Any</code> with another <code>Any</code>.
76 * @param other the other instance to compare with.
78 * @return true if both values and value typecodes are equal,
79 * false otherwise.
81 public abstract boolean equal(Any other);
83 /**
84 * Extract the CORBA <code>Object</code> from this <code>Any</code>
85 * @throws BAD_OPERATION if this instance contains value other
86 * than <code>Object</code> or the value has not been set.
88 public abstract org.omg.CORBA.Object extract_Object()
89 throws BAD_OPERATION;
91 /**
92 * Extract the CORBA <code>Principal</code> from this <code>Any</code>
94 * @throws NO_IMPLEMENT, always.
96 * @deprecated by CORBA 2.2.
98 public Principal extract_Principal()
100 throw new NO_IMPLEMENT();
104 * Extract an arbitrary {@link org.omg.CORBA.portable.Streamable } from
105 * this <code>Any</code>.
107 * @throws BAD_INV_ORDER if the caller has invoked operations in the
108 * wrong order.
110 * @throws NO_IMPLEMENT, always (override to get functionality).
112 public org.omg.CORBA.portable.Streamable extract_Streamable()
113 throws org.omg.CORBA.BAD_INV_ORDER
115 throw new NO_IMPLEMENT();
119 * Extract the TypeCode from this <code>Any</code> value field.
121 * @throws BAD_OPERATION if this instance contains value other
122 * than <code>TypeCode</code> or the value has not been set.
124 public abstract TypeCode extract_TypeCode()
125 throws BAD_OPERATION;
128 * Extract the CORBA <code>Value</code> from this <code>Any</code>
129 * @throws BAD_OPERATION if this instance contains value other
130 * than <code>Value</code> or the value has not been set.
132 public abstract java.io.Serializable extract_Value()
133 throws BAD_OPERATION;
136 * Extract another <code>Any</code> from this <code>Any</code>.
138 * @throws BAD_OPERATION if this instance contains value other
139 * than <code>any</code> or the value has not been set.
141 public abstract Any extract_any()
142 throws BAD_OPERATION;
145 * Extract the CORBA <code>boolean</code> from this <code>Any</code>.
147 * @throws BAD_OPERATION if this instance contains value other
148 * than <code>boolean</code> or the value has not been set.
150 public abstract boolean extract_boolean()
151 throws BAD_OPERATION;
154 * Extract the CORBA <code>char</code> from this <code>Any</code>.
156 * @throws BAD_OPERATION if this instance contains value other
157 * than <code>char</code> or the value has not been set.
159 public abstract char extract_char()
160 throws BAD_OPERATION;
163 * Extract the CORBA <code>double</code> from this <code>Any</code>.
165 * @throws BAD_OPERATION if this instance contains value other
166 * than <code>double</code> or the value has not been set.
168 public abstract double extract_double()
169 throws BAD_OPERATION;
172 * Extract the CORBA <code>fixed</code> from this <code>Any</code>.
174 * @throws BAD_OPERATION if this instance contains value other
175 * than <code>fixed</code> or the value has not been set.
177 * @throws NO_IMPLEMENT, always (override to get functionality).
179 public java.math.BigDecimal extract_fixed()
180 throws BAD_OPERATION
182 throw new NO_IMPLEMENT();
186 * Extract the CORBA <code>float</code> from this <code>Any</code>.
188 * @throws BAD_OPERATION if this instance contains value other
189 * than <code>float</code> or the value has not been set.
191 public abstract float extract_float()
192 throws BAD_OPERATION;
195 * Extract the CORBA <code>long</code> from this <code>Any</code>.
197 * @throws BAD_OPERATION if this instance contains value other
198 * than <code>long</code> or the value has not been set.
200 public abstract int extract_long()
201 throws BAD_OPERATION;
204 * Extract the CORBA <code>long long</code> from this <code>Any</code>.
206 * @throws BAD_OPERATION if this instance contains value other
207 * than <code>longlong</code> or the value has not been set.
209 public abstract long extract_longlong()
210 throws BAD_OPERATION;
213 * Extract the CORBA <code>octet</code> from this <code>Any</code>.
215 * @throws BAD_OPERATION if this instance contains value other
216 * than <code>octet</code> or the value has not been set.
218 public abstract byte extract_octet()
219 throws BAD_OPERATION;
222 * Extract the CORBA <code>short</code> from this <code>Any</code>.
224 * @throws BAD_OPERATION if this instance contains value other
225 * than <code>short</code> or the value has not been set.
227 public abstract short extract_short()
228 throws BAD_OPERATION;
231 * Extract the CORBA <code>string</code> from this <code>Any</code>.
233 * @throws BAD_OPERATION if this instance contains value other
234 * than <code>string</code> or the value has not been set.
236 public abstract String extract_string()
237 throws BAD_OPERATION;
240 * Extract the CORBA unsigned <code>long</code> from this <code>Any</code>
241 * @throws BAD_OPERATION if this instance contains value other
242 * than unsigned <code>long</code> or the value has not been set.
244 public abstract int extract_ulong()
245 throws BAD_OPERATION;
248 * Extract the CORBA unsigned <code>long long</code> from this
249 * <code>Any</code>.
251 * @throws BAD_OPERATION if this instance contains value other
252 * than unsigned <code>long long</code> or the value has not been set.
254 public abstract long extract_ulonglong()
255 throws BAD_OPERATION;
258 * Extract the CORBA unsigned <code>short</code> from this <code>Any</code>
259 * @throws BAD_OPERATION if this instance contains value other
260 * than unsigned <code>short</code> or the value has not been set.
262 public abstract short extract_ushort()
263 throws BAD_OPERATION;
266 * Extract the CORBA <code>wchar</code> from this <code>Any</code>
267 * @throws BAD_OPERATION if this instance contains value other
268 * than <code>wchar</code> or the value has not been set.
270 public abstract char extract_wchar()
271 throws BAD_OPERATION;
274 * Extract the CORBA <code>wstring</code> from this <code>Any</code>
275 * @throws BAD_OPERATION if this instance contains value other
276 * than <code>wstring</code> or the value has not been set.
278 public abstract String extract_wstring()
279 throws BAD_OPERATION;
282 * Insert the CORBA <code>Object</code> into this <code>Any</code>
284 public abstract void insert_Object(org.omg.CORBA.Object x, TypeCode typecode);
287 * Insert the CORBA <code>Object</code> into this <code>Any</code>
289 public abstract void insert_Object(org.omg.CORBA.Object x);
292 * Insert the CORBA <code>Principal</code> into this <code>Any</code>.
293 * @deprecated by CORBA 2.2.
295 public void insert_Principal(Principal x)
297 throw new NO_IMPLEMENT();
301 * Insert the CORBA <code>Streamable</code> into this <code>Any</code>
303 public void insert_Streamable(org.omg.CORBA.portable.Streamable x)
305 throw new NO_IMPLEMENT();
309 * Insert the CORBA <code>TypeCode</code> into this <code>Any</code>
310 * value field.
312 public abstract void insert_TypeCode(TypeCode typecode);
315 * Insert the CORBA <code>Value</code> into this <code>Any</code>.
317 * The type of the Any should be set (by {@link #type(TypeCode)})
318 * before inserting the value.
320 public abstract void insert_Value(Serializable x, TypeCode typecode);
323 * Insert the CORBA <code>Value</code> into this <code>Any</code>.
325 * The type of the Any should be set (by {@link #type(TypeCode)})
326 * before inserting the value.
328 public abstract void insert_Value(Serializable x);
331 * Insert the CORBA <code>any</code> into this <code>Any</code>
333 public abstract void insert_any(Any x);
336 * Insert the CORBA <code>boolean</code> into this <code>Any</code>
338 public abstract void insert_boolean(boolean x);
341 * Insert the CORBA <code>char</code> into this <code>Any</code>
343 public abstract void insert_char(char x);
346 * Insert the CORBA <code>double</code> into this <code>Any</code>
348 public abstract void insert_double(double x);
351 * Insert the CORBA <code>fixed</code> into this <code>Any</code>
353 public void insert_fixed(java.math.BigDecimal x, TypeCode typecode)
355 throw new NO_IMPLEMENT();
359 * Insert the CORBA <code>fixed</code> into this <code>Any</code>
361 public void insert_fixed(java.math.BigDecimal x)
363 throw new NO_IMPLEMENT();
367 * Insert the CORBA <code>float</code> into this <code>Any</code>
369 public abstract void insert_float(float x);
372 * Insert the CORBA <code>long</code> into this <code>Any</code>
374 public abstract void insert_long(int x);
377 * Insert the CORBA <code>longlong</code> into this <code>Any</code>
379 public abstract void insert_longlong(long x);
382 * Insert the CORBA <code>octet</code> into this <code>Any</code>
384 public abstract void insert_octet(byte x);
387 * Insert the CORBA <code>short</code> into this <code>Any</code>
389 public abstract void insert_short(short x);
392 * Insert the CORBA <code>string</code> into this <code>Any</code>
394 public abstract void insert_string(String x);
397 * Insert the CORBA <code>ulong</code> into this <code>Any</code>
399 public abstract void insert_ulong(int x);
402 * Insert the CORBA <code>ulonglong</code> into this <code>Any</code>
404 public abstract void insert_ulonglong(long x);
407 * Insert the CORBA <code>ushort</code> into this <code>Any</code>
409 public abstract void insert_ushort(short x);
412 * Insert the CORBA <code>wchar</code> into this <code>Any</code>
414 public abstract void insert_wchar(char x);
417 * Insert the CORBA <code>wstring</code> into this <code>Any</code>
419 public abstract void insert_wstring(String x);
422 * Read the value into this <code>Any</code> from the given input stream.
424 * @param input a CORBA stream to read from.
425 * @param type a TypeCode of the object being read.
427 * @throws org.omg.CORBA.MARSHAL if the given TypeCode does not match
428 * the TypeCode of the object, found in the stream.
430 public abstract void read_value(org.omg.CORBA.portable.InputStream input,
431 TypeCode type
433 throws MARSHAL;
436 * Set the type of the object, stored in this <code>Any</code>, to the
437 * given TypeCode. Clear the value.
439 * @param valueTypeCode the type of the object that is expected to be stored
440 * in this <code>any</code>.
442 public abstract void type(TypeCode valueTypeCode);
445 * Returns the TypeCode of the object, stored in this <code>Any</code>
446 * @return the TypeCode
448 public abstract TypeCode type();
451 * Writes out the value (without the typecode of the value), stored in
452 * this <code>Any</code>.
454 * @param output the CORBA stream to write into.
456 * @throws NullPointerException if the value of this <code>Any</code>
457 * has not been set.
459 public abstract void write_value(org.omg.CORBA.portable.OutputStream output);