|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Object![]()
![]()
![]()
org.omg.CORBA.Any
, IDLEntity

public abstract class Any


Serves as a container for any data that can be
described in IDL or for any IDL primitive type.
An Any object is used as a component of a
NamedValue object, which provides information about
arguments or return values in requests, and which is used to define
name/value pairs in Context objects.
An Any object consists of two parts:
TypeCode object describing the type of the data
value contained in the Any object. For example,
a TypeCode object for an array contains
a field for the length of the array and a field for
the type of elements in the array. (Note that in this case, the
second field of the TypeCode object is itself a
TypeCode object.)
A large part of the
For a given primitive type X, these methods are:
This method throws the exception
There are distinct method pairs for each
primitive IDL data type (
The class
Any class consists of pairs of methods
for inserting values into and extracting values from an
Any object.
x of primitive type X
into the value field of the Any object.
Note that the method
insert_X also resets the Any object's
type field if necessary.
X from the Any object.
BAD_OPERATION under two conditions:
Any object is not
X
extract_X is called before
the value field of the Any object
has been set
insert_long and extract_long,
insert_string and extract_string, and so on).
Any also has methods for
getting and setting the type code,
for testing two Any objects for equality,
and for reading an Any object from a stream or
writing it to a stream.
| Constructor Summary | |
|---|---|
Any
|
|
| Method Summary | |
|---|---|
abstract InputStream |
create_input_stream
Creates an input stream from which this Any object's value
can be unmarshalled. |
abstract OutputStream |
create_output_stream
Creates an output stream into which this Any object's
value can be marshalled. |
abstract boolean |
equal
Checks for equality between this Any object and the
given Any object. |
abstract Any |
extract_any
Extracts the Any object in this
Any object's value field. |
abstract boolean |
extract_boolean
Extracts the boolean in this
Any object's value field. |
abstract char |
extract_char
Extracts the char in this
Any object's value field. |
abstract double |
extract_double
Extracts the double in this
Any object's value field. |
BigDecimal |
extract_fixed
Extracts the java.math.BigDecimal object in this
Any object's value field. |
abstract float |
extract_float
Extracts the float in this
Any object's value field. |
abstract int |
extract_long
Extracts the int in this
Any object's value field. |
abstract long |
extract_longlong
Extracts the long in this
Any object's value field. |
abstract Object |
extract_Object
Extracts the org.omg.CORBA.Object in this
Any object's value field. |
abstract byte |
extract_octet
Extracts the byte in this
Any object's value field. |
Principal |
extract_Principal
Deprecated. Deprecated by CORBA 2.2. |
abstract short |
extract_short
Extracts the short in this
Any object's value field. |
Streamable |
extract_Streamable
Extracts a Streamable from this Any object's
value field. |
abstract String |
extract_string
Extracts the String object in this
Any object's value field. |
abstract TypeCode |
extract_TypeCode
Extracts the TypeCode object in this
Any object's value field. |
abstract int |
extract_ulong
Extracts the int in this
Any object's value field. |
abstract long |
extract_ulonglong
Extracts the long in this
Any object's value field. |
abstract short |
extract_ushort
Extracts the short in this
Any object's value field. |
abstract Serializable |
extract_Value
Extracts the java.io.Serializable object in this
Any object's value field. |
abstract char |
extract_wchar
Extracts the char in this
Any object's value field. |
abstract String |
extract_wstring
Extracts the String object in this
Any object's value field. |
abstract void |
insert_any
Inserts the given Any object
into this Any object's value field. |
abstract void |
insert_boolean
Inserts the given boolean
into this Any object's value field. |
abstract void |
insert_char
Inserts the given char
into this Any object's value field. |
abstract void |
insert_double
Inserts the given double
into this Any object's value field. |
void |
insert_fixed
Throws an org.omg.CORBA.NO_IMPLEMENT exception. |
void |
insert_fixed
Throws an org.omg.CORBA.NO_IMPLEMENT exception. |
abstract void |
insert_float
Inserts the given float
into this Any object's value field. |
abstract void |
insert_long
Inserts the given int
into this Any object's value field. |
abstract void |
insert_longlong
Inserts the given long
into this Any object's value field. |
abstract void |
insert_Object
Inserts the given org.omg.CORBA.Object object
into this Any object's value field. |
abstract void |
insert_Object
Inserts the given org.omg.CORBA.Object object
into this Any object's value field. |
abstract void |
insert_octet
Inserts the given byte
into this Any object's value field. |
void |
insert_Principal
Deprecated. Deprecated by CORBA 2.2. |
abstract void |
insert_short
Inserts the given short
into this Any object's value field. |
void |
insert_Streamable
Inserts the given Streamable object
into this Any object's value field. |
abstract void |
insert_string
Inserts the given String object
into this Any object's value field. |
abstract void |
insert_TypeCode
Inserts the given TypeCode object
into this Any object's value field. |
abstract void |
insert_ulong
Inserts the given int
into this Any object's value field. |
abstract void |
insert_ulonglong
Inserts the given long
into this Any object's value field. |
abstract void |
insert_ushort
Inserts the given short
into this Any object's value field. |
abstract void |
insert_Value
Inserts the given java.io.Serializable object
into this Any object's value field. |
abstract void |
insert_Value
Inserts the given java.io.Serializable object
into this Any object's value field. |
abstract void |
insert_wchar
Inserts the given char
into this Any object's value field. |
abstract void |
insert_wstring
Inserts the given String object
into this Any object's value field. |
abstract void |
read_value
Reads off (unmarshals) the value of an Any object from
the given input stream using the given typecode. |
abstract TypeCode |
type
Returns type information for the element contained in this Any object. |
abstract void |
type
Sets this Any object's type field
to the given TypeCode object and clears its value. |
abstract void |
write_value
Writes out the value of this Any object
to the given output stream. |
Methods inherited from class java.lang.Object ![]() |
|---|
clone |
| Constructor Detail |
|---|

public Any()
| Method Detail |
|---|

public abstract boolean equal(Any![]()
![]()
a)
Any object and the
given Any object. Two Any objects are
equal if both their values and type codes are equal.
a - the Any object to test for equality
true if the Any objects are equal;
false otherwiseCORBA package
comments for unimplemented features

public abstract TypeCode![]()
![]()
type()
Any object.
TypeCode object containing type information
about the value contained in this Any object

public abstract void type(TypeCode![]()
![]()
t)
Any object's type field
to the given TypeCode object and clears its value.
Note that using this method to set the type code wipes out the
value if there is one. The method
is provided primarily so that the type may be set properly for
IDL out parameters. Generally, setting the type
is done by the insert_X methods, which will set the type
to X if it is not already set to X.
t - the TypeCode object giving
information for the value in
this Any object

public abstract void read_value(InputStream![]()
![]()
is, TypeCode
![]()
![]()
t) throws MARSHAL
![]()
![]()
Any object from
the given input stream using the given typecode.
is - the org.omg.CORBA.portable.InputStream
object from which to read
the value contained in this Any objectt - a TypeCode object containing type information
about the value to be read
MARSHAL

- when the given TypeCode object is
not consistent with the value that was contained
in the input stream

public abstract void write_value(OutputStream![]()
![]()
os)
Any object
to the given output stream. If both typecode
and value need to be written, use
create_output_stream() to create an OutputStream,
then use write_any on the OutputStream.
If this method is called on an Any object that has not
had a value inserted into its value field, it will throw
the exception java.lang.NullPointerException.
os - the org.omg.CORBA.portable.OutputStream
object into which to marshal the value
of this Any object

public abstract OutputStream![]()
![]()
create_output_stream()
Any object's
value can be marshalled.
OutputStream

public abstract InputStream![]()
![]()
create_input_stream()
Any object's value
can be unmarshalled.
InputStream

public abstract short extract_short()
throws BAD_OPERATION

short in this
Any object's value field.
short stored in this Any object
BAD_OPERATION

- if this Any object
contains something other than a short or the
value field has not yet been set

public abstract void insert_short(short s)
short
into this Any object's value field.
s - the short to insert into this
Any object

public abstract int extract_long()
throws BAD_OPERATION

int in this
Any object's value field.
int stored in this Any object
BAD_OPERATION

- if this Any object
contains something other than an int or the
value field has not yet been set

public abstract void insert_long(int l)
int
into this Any object's value field.
l - the int to insert into this
Any object

public abstract long extract_longlong()
throws BAD_OPERATION

long in this
Any object's value field.
long stored in this Any object
BAD_OPERATION

- if this Any object
contains something other than a long or the
value field has not yet been set

public abstract void insert_longlong(long l)
long
into this Any object's value field.
l - the long to insert into this
Any object

public abstract short extract_ushort()
throws BAD_OPERATION

short in this
Any object's value field.
short stored in this Any object
BAD_OPERATION

- if this Any object
contains something other than a short or the
value field has not yet been set

public abstract void insert_ushort(short s)
short
into this Any object's value field.
s - the short to insert into this
Any object

public abstract int extract_ulong()
throws BAD_OPERATION

int in this
Any object's value field.
int stored in this Any object
BAD_OPERATION

- if this Any object
contains something other than an int or the
value field has not yet been set

public abstract void insert_ulong(int l)
int
into this Any object's value field.
l - the int to insert into this
Any object

public abstract long extract_ulonglong()
throws BAD_OPERATION

long in this
Any object's value field.
long stored in this Any object
BAD_OPERATION

- if this Any object
contains something other than a long or the
value field has not yet been set

public abstract void insert_ulonglong(long l)
long
into this Any object's value field.
l - the long to insert into this
Any object

public abstract float extract_float()
throws BAD_OPERATION

float in this
Any object's value field.
float stored in this Any object
BAD_OPERATION

- if this Any object
contains something other than a float or the
value field has not yet been set

public abstract void insert_float(float f)
flo