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