All Packages  Class Hierarchy  This Package  Previous  Next  Index

Class org.omg.CORBA.Any

java.lang.Object
   |
   +----org.omg.CORBA.Any

public abstract class Any
extends Object
The Any type is used to store a value of any type. For example, an any can store a string, an interface object, or even another any. Methods are provided to put values into and retrieve values out of an any. It is an error to attempt to retrieve a type from an any which is different from the type store into the any. For example, it is an error to attempt to extract a string from an any that is storing a float. By default, an any contains a null. Nothing may be extracted from an any until it has been initialized with a value. Type codes are used to define the type of the value stored in the any. The any type is used extensively in conjunction with the dynamic invocation interface.

See Also:
TypeCode, Request

Constructor Index

 o Any()

Method Index

 o create_input_stream()
Create an input stream containing the any's value.
 o create_output_stream()
Create an empty output stream.
 o equal(Any)
Returns true if the value contained by the any is the same as the value contained by the rhs, false otherwise.
 o extract_any()
Returns the value of the any contained by the any.
 o extract_boolean()
Returns the value of the boolean contained by the any.
 o extract_char()
Returns the value of the char contained by the any.
 o extract_double()
Returns the value of the double contained by the any.
 o extract_float()
Returns the value of the float contained by the any.
 o extract_long()
Returns the value of the long contained by the any.
 o extract_longlong()
Returns the value of the long long contained by the any.
 o extract_Object()
Returns the value of the org.omg.CORBA.Object contained by the any.
 o extract_octet()
Returns the value of the octet contained by the any.
 o extract_Principal()
Returns the value of the Principal contained by the any.
 o extract_short()
Returns the value of the short contained by the any.
 o extract_string()
Returns the value of the string contained by the any.
 o extract_TypeCode()
Returns the value of the TypeCode contained by the any.
 o extract_ulong()
Returns the value of the unsigned long contained by the any.
 o extract_ulonglong()
Returns the value of the unsigned long long contained by the any.
 o extract_ushort()
Returns the value of the unsigned short contained by the any.
 o extract_wchar()
Returns the value of the wchar contained by the any.
 o extract_wstring()
Returns the value of the wstring contained by the any.
 o insert_any(Any)
Stores the value in the any as a any.
 o insert_boolean(boolean)
Stores the value in the any as a boolean.
 o insert_char(char)
Stores the value in the any as a char.
 o insert_double(double)
Stores the value in the any as a double.
 o insert_float(float)
Stores the value in the any as a float.
 o insert_long(int)
Stores the value in the any as a long.
 o insert_longlong(long)
Stores the value in the any as a longlong.
 o insert_Object(Object)
Stores the value in the any as a org.omg.CORBA.Object.
 o insert_Object(Object, TypeCode)
Stores the value in the any as an interface object.
 o insert_octet(byte)
Stores the value in the any as a octet.
 o insert_Principal(Principal)
Stores the value in the any as a Principal.
 o insert_short(short)
Stores the value in the any as a short.
 o insert_Streamable(Streamable)
Stores the value in the any as a Streamable.
 o insert_string(String)
Stores the value in the any as a string.
 o insert_TypeCode(TypeCode)
Stores the value in the any as a TypeCode.
 o insert_ulong(int)
Stores the value in the any as a unsigned long.
 o insert_ulonglong(long)
Stores the value in the any as a unsigned long long.
 o insert_ushort(short)
Stores the value in the any as a unsigned short.
 o insert_wchar(char)
Stores the value in the any as a wchar.
 o insert_wstring(String)
Stores the value in the any as a wstring.
 o read_value(InputStream, TypeCode)
Reads an any's value from an input stream given a type code.
 o type()
Returns the type of the value contained by the any.
 o type(TypeCode)
Set the type of the any.
 o write_value(OutputStream)
Writes an any's value to an output stream.

Constructors

 o Any
 public Any()

Methods

 o type
 public abstract TypeCode type()
Returns the type of the value contained by the any.

 o type
 public abstract void type(TypeCode type)
Set the type of the any. This method will clear the previous value from the any.

Parameters:
type - The new type code of the any value.
 o read_value
 public abstract void read_value(InputStream input,
                                 TypeCode type)
Reads an any's value from an input stream given a type code. Note that only the any's value is read. To read the complete any definition (includeing the type code) use org.omg.CORBA.InputStream.read_any.

Parameters:
input - A GIOP input stream from which the specified type's value will be read.
type - The type code to read from the input stream.
 o write_value
 public abstract void write_value(OutputStream output)
Writes an any's value to an output stream. Note that only the any's value is written. To write the complete any definition (includeing the type code) use org.omg.CORBA.OutputStream.write_any.

Parameters:
output - A GIOP output stream into which the specified type's value is written.
 o create_output_stream
 public abstract OutputStream create_output_stream()
Create an empty output stream.

 o create_input_stream
 public abstract InputStream create_input_stream()
Create an input stream containing the any's value.

 o equal
 public abstract boolean equal(Any rhs)
Returns true if the value contained by the any is the same as the value contained by the rhs, false otherwise.

 o extract_short
 public abstract short extract_short()
Returns the value of the short contained by the any.

Throws: BAD_PARAM
if the any does not contain a short.
 o insert_short
 public abstract void insert_short(short value)
Stores the value in the any as a short.

 o extract_long
 public abstract int extract_long()
Returns the value of the long contained by the any.

Throws: BAD_PARAM
if the any does not contain a long.
 o insert_long
 public abstract void insert_long(int value)
Stores the value in the any as a long.

 o extract_longlong
 public abstract long extract_longlong()
Returns the value of the long long contained by the any.

Throws: BAD_PARAM
if the any does not contain a long long.
 o insert_longlong
 public abstract void insert_longlong(long value)
Stores the value in the any as a longlong.

 o extract_ushort
 public abstract short extract_ushort()
Returns the value of the unsigned short contained by the any.

Throws: BAD_PARAM
if the any does not contain a unsigned short.
 o insert_ushort
 public abstract void insert_ushort(short value)
Stores the value in the any as a unsigned short.

 o extract_ulong
 public abstract int extract_ulong()
Returns the value of the unsigned long contained by the any.

Throws: BAD_PARAM
if the any does not contain a unsigned long.
 o insert_ulong
 public abstract void insert_ulong(int value)
Stores the value in the any as a unsigned long.

 o extract_ulonglong
 public abstract long extract_ulonglong()
Returns the value of the unsigned long long contained by the any.

Throws: BAD_PARAM
if the any does not contain a unsigned long long.
 o insert_ulonglong
 public abstract void insert_ulonglong(long value)
Stores the value in the any as a unsigned long long.

 o extract_float
 public abstract float extract_float()
Returns the value of the float contained by the any.

Throws: BAD_PARAM
if the any does not contain a float.
 o insert_float
 public abstract void insert_float(float value)
Stores the value in the any as a float.

 o extract_double
 public abstract double extract_double()
Returns the value of the double contained by the any.

Throws: BAD_PARAM
if the any does not contain a double.
 o insert_double
 public abstract void insert_double(double value)
Stores the value in the any as a double.

 o extract_boolean
 public abstract boolean extract_boolean()
Returns the value of the boolean contained by the any.

Throws: BAD_PARAM
if the any does not contain a boolean.
 o insert_boolean
 public abstract void insert_boolean(boolean value)
Stores the value in the any as a boolean.

 o extract_char
 public abstract char extract_char()
Returns the value of the char contained by the any.

Throws: BAD_PARAM
if the any does not contain a char.
 o insert_char
 public abstract void insert_char(char value)
Stores the value in the any as a char.

 o extract_wchar
 public abstract char extract_wchar()
Returns the value of the wchar contained by the any.

Throws: BAD_PARAM
if the any does not contain a wchar.
 o insert_wchar
 public abstract void insert_wchar(char value)
Stores the value in the any as a wchar.

 o extract_octet
 public abstract byte extract_octet()
Returns the value of the octet contained by the any.

Throws: BAD_PARAM
if the any does not contain a octet.
 o insert_octet
 public abstract void insert_octet(byte value)
Stores the value in the any as a octet.

 o extract_any
 public abstract Any extract_any()
Returns the value of the any contained by the any.

Throws: BAD_PARAM
if the any does not contain a any.
 o insert_any
 public abstract void insert_any(Any value)
Stores the value in the any as a any.

 o extract_TypeCode
 public abstract TypeCode extract_TypeCode()
Returns the value of the TypeCode contained by the any.

Throws: BAD_PARAM
if the any does not contain a TypeCode.
 o insert_TypeCode
 public abstract void insert_TypeCode(TypeCode value)
Stores the value in the any as a TypeCode.

 o extract_Object
 public abstract Object extract_Object()
Returns the value of the org.omg.CORBA.Object contained by the any.

Throws: BAD_PARAM
if the any does not contain a org.omg.CORBA.Object.
 o insert_Object
 public abstract void insert_Object(Object value)
Stores the value in the any as a org.omg.CORBA.Object.

 o insert_Object
 public abstract void insert_Object(Object value,
                                    TypeCode type)
Stores the value in the any as an interface object. Note that the method insert_Object(org.omg.CORBA.Object) simply stores the interface object as a org.omg.CORBA.Object, whereas this method can be used to store the interface object as a more specialized type.

Parameters:
type - The type code of the interface associated with the interface object.
Throws: BAD_PARAM
if the type code's kind is not org.omg.CORBA.TCKind.tk_objref.
 o extract_string
 public abstract String extract_string()
Returns the value of the string contained by the any.

Throws: BAD_PARAM
if the any does not contain a string.
 o insert_string
 public abstract void insert_string(String value)
Stores the value in the any as a string.

 o extract_wstring
 public abstract String extract_wstring()
Returns the value of the wstring contained by the any.

Throws: BAD_PARAM
if the any does not contain a wstring.
 o insert_wstring
 public abstract void insert_wstring(String value)
Stores the value in the any as a wstring.

 o extract_Principal
 public abstract Principal extract_Principal()
Returns the value of the Principal contained by the any.

Throws: BAD_PARAM
if the any does not contain a Principal.
 o insert_Principal
 public abstract void insert_Principal(Principal value)
Stores the value in the any as a Principal.

 o insert_Streamable
 public abstract void insert_Streamable(Streamable value)
Stores the value in the any as a Streamable.


All Packages  Class Hierarchy  This Package  Previous  Next  Index