gnu.CORBA

Class gnuAny

Implemented Interfaces:
IDLEntity, Serializable

public class gnuAny
extends Any

The implementation of Any. For performance reasonse, the inserted values are not cloned. If the value object allows modifications (like Streamable), these subsequent alterations are reflected by the instance of this gnuAny, and the gnuAny alterations are reflected by the returned value. If it is required to have the uncoupled value, it must be requested from the copy of the current instance. The gnuAny can be simply cloned by the provided Clone() method.
See Also:
Serialized Form

Field Summary

protected Streamable
has
The Streamable, representing the value, held by this gnuAny.
protected static TypeCode
nullType
The value, returned by type() if the value has been not intialized.
protected TypeCode
typecode
The complete typecode of the Streamable, if explicitly set.
protected int
xKind
The typecode kind of the Streamable, if explicitly set.

Method Summary

gnuAny
Clone()
Creates a deep copy of this gnuAny, writing to and subsequently reading from from the byte buffer.
protected void
check(int kind)
Check if the current value if the value of the given kind.
InputStream
create_input_stream()
Create the buffered CDR input stream, containing the value, stored inside of this Any.
OutputStream
create_output_stream()
Create the buffered CDR output stream (empty).
boolean
equal(Any other)
Compare two Any's for equality.
boolean
equals(Object other)
Delegates functionality to equal(Any).
Object
extract_Object()
Extract the previously stored object.
Principal
extract_Principal()
Deprecated. by CORBA 2.2.
Streamable
extract_Streamable()
Return the value, encapsulated in a suitable holder.
TypeCode
extract_TypeCode()
Serializable
extract_Value()
Extract the stored value type.
Any
extract_any()
boolean
extract_boolean()
char
extract_char()
double
extract_double()
BigDecimal
extract_fixed()
Extract the previously inserted CORBA fixed/
float
extract_float()
int
extract_long()
long
extract_longlong()
byte
extract_octet()
short
extract_short()
String
extract_string()
int
extract_ulong()
long
extract_ulonglong()
short
extract_ushort()
char
extract_wchar()
String
extract_wstring()
int
hashCode()
Get the content - dependent hashcode.
void
insert_Object(Object x)
Inserts the CORBA object.
void
insert_Object(Object x, TypeCode typecode)
Inserts the CORBA object and sets the typecode to the given type.
void
insert_Principal(Principal x)
Deprecated. by CORBA 2.2.
void
insert_Streamable(Streamable x)
Sets the value to the value, encapsulated in this holder.
void
insert_TypeCode(TypeCode typecode)
Insert the typecode into this Any
void
insert_Value(Serializable x)
void
insert_Value(Serializable x, TypeCode c_typecode)
void
insert_any(Any an_any)
Insert another Any into this Any.
void
insert_boolean(boolean x)
void
insert_char(char x)
void
insert_double(double x)
void
insert_fixed(BigDecimal x)
Inserts the CORBA fixed, setting the typecode by example of the currently passed value.
void
insert_fixed(BigDecimal x, TypeCode x_typecode)
Inserts the CORBA fixed, setting the typecode explicitly.
void
insert_float(float x)
void
insert_long(int x)
void
insert_longlong(long x)
void
insert_octet(byte x)
void
insert_short(short x)
void
insert_string(String x)
void
insert_ulong(int x)
void
insert_ulonglong(long x)
void
insert_ushort(short x)
void
insert_wchar(char x)
void
insert_wstring(String x)
ORB
orb()
Return the associated orb.
void
read_value(InputStream input, TypeCode a_type)
Read the value of the given type from the given stream.
void
setOrb(ORB an_orb)
Set the associated orb.
TypeCode
type()
void
type(TypeCode valueTypeCode)
Explicitly set the typecode of the value to the given type.
void
write_value(OutputStream output)

Methods inherited from class org.omg.CORBA.Any

create_input_stream, create_output_stream, equal, extract_Object, extract_Principal, extract_Streamable, extract_TypeCode, extract_Value, extract_any, extract_boolean, extract_char, extract_double, extract_fixed, extract_float, extract_long, extract_longlong, extract_octet, extract_short, extract_string, extract_ulong, extract_ulonglong, extract_ushort, extract_wchar, extract_wstring, insert_Object, insert_Object, insert_Principal, insert_Streamable, insert_TypeCode, insert_Value, insert_Value, insert_any, insert_boolean, insert_char, insert_double, insert_fixed, insert_fixed, insert_float, insert_long, insert_longlong, insert_octet, insert_short, insert_string, insert_ulong, insert_ulonglong, insert_ushort, insert_wchar, insert_wstring, read_value, type, type, write_value

Methods inherited from class java.lang.Object

clone, equals, extends Object> getClass, finalize, hashCode, notify, notifyAll, toString, wait, wait, wait

Field Details

has

protected Streamable has
The Streamable, representing the value, held by this gnuAny.

nullType

protected static final TypeCode nullType
The value, returned by type() if the value has been not intialized.

typecode

protected TypeCode typecode
The complete typecode of the Streamable, if explicitly set.

xKind

protected int xKind
The typecode kind of the Streamable, if explicitly set.

Method Details

Clone

public gnuAny Clone()
Creates a deep copy of this gnuAny, writing to and subsequently reading from from the byte buffer.
Returns:
the uncoupled gnuAny with all fields set to identical values.

check

protected void check(int kind)
            throws BAD_OPERATION
Check if the current value if the value of the given kind.
Parameters:
kind - a kind to check.
Throws:
BAD_OPERATION - if the value is not set of is different kind.

create_input_stream

public InputStream create_input_stream()
Create the buffered CDR input stream, containing the value, stored inside of this Any.
Overrides:
create_input_stream in interface Any

create_output_stream

public OutputStream create_output_stream()
Create the buffered CDR output stream (empty).
Overrides:
create_output_stream in interface Any

equal

public boolean equal(Any other)
Compare two Any's for equality.
Overrides:
equal in interface Any
Parameters:
other - the other Any to compare.

equals

public boolean equals(Object other)
Delegates functionality to equal(Any).
Overrides:
equals in interface Object

extract_Object

public Object extract_Object()
Extract the previously stored object.
Overrides:
extract_Object in interface Any

extract_Principal

public Principal extract_Principal()

Deprecated. by CORBA 2.2.

Extract the previously inserted CORBA Principal/
Overrides:
extract_Principal in interface Any
Returns:
the previously inserted value.
Throws:
BAD_OPERATION - if the holder contains something else than Principal.

extract_Streamable

public Streamable extract_Streamable()
Return the value, encapsulated in a suitable holder. This implementation returns the direct reference, so the alterations on the returned streamable are directly reflected to the content of this Any.
Overrides:
extract_Streamable in interface Any

extract_TypeCode

public TypeCode extract_TypeCode()
            throws BAD_OPERATION
Overrides:
extract_TypeCode in interface Any

extract_Value

public Serializable extract_Value()
            throws BAD_OPERATION
Extract the stored value type.
Overrides:
extract_Value in interface Any
Returns:
the previously stored value type.
Throws:
BAD_OPERATION - if the Any contains something different.
See Also:
ValueBase

extract_any

public Any extract_any()
            throws BAD_OPERATION
Overrides:
extract_any in interface Any

extract_boolean

public boolean extract_boolean()
            throws BAD_OPERATION
Overrides:
extract_boolean in interface Any

extract_char

public char extract_char()
            throws BAD_OPERATION
Overrides:
extract_char in interface Any

extract_double

public double extract_double()
            throws BAD_OPERATION
Overrides:
extract_double in interface Any

extract_fixed

public BigDecimal extract_fixed()
            throws BAD_OPERATION
Extract the previously inserted CORBA fixed/
Overrides:
extract_fixed in interface Any
Returns:
the previously inserted value.
Throws:
BAD_OPERATION - if the holder contains something else than BigDecimal.

extract_float

public float extract_float()
            throws BAD_OPERATION
Overrides:
extract_float in interface Any

extract_long

public int extract_long()
            throws BAD_OPERATION
Overrides:
extract_long in interface Any

extract_longlong

public long extract_longlong()
            throws BAD_OPERATION
Overrides:
extract_longlong in interface Any

extract_octet

public byte extract_octet()
            throws BAD_OPERATION
Overrides:
extract_octet in interface Any

extract_short

public short extract_short()
            throws BAD_OPERATION
Overrides:
extract_short in interface Any

extract_string

public String extract_string()
            throws BAD_OPERATION
Overrides:
extract_string in interface Any

extract_ulong

public int extract_ulong()
            throws BAD_OPERATION
Overrides:
extract_ulong in interface Any

extract_ulonglong

public long extract_ulonglong()
            throws BAD_OPERATION
Overrides:
extract_ulonglong in interface Any

extract_ushort

public short extract_ushort()
            throws BAD_OPERATION
Overrides:
extract_ushort in interface Any

extract_wchar

public char extract_wchar()
            throws BAD_OPERATION
Overrides:
extract_wchar in interface Any

extract_wstring

public String extract_wstring()
            throws BAD_OPERATION
Overrides:
extract_wstring in interface Any

hashCode

public int hashCode()
Get the content - dependent hashcode.
Overrides:
hashCode in interface Object

insert_Object

public void insert_Object(Object x)
Inserts the CORBA object.
Overrides:
insert_Object in interface Any

insert_Object

public void insert_Object(Object x,
                          TypeCode typecode)
Inserts the CORBA object and sets the typecode to the given type.
Overrides:
insert_Object in interface Any

insert_Principal

public void insert_Principal(Principal x)

Deprecated. by CORBA 2.2.

Insert the CORBA Principal. This implementation uses direct assignment, so the later alterations of that BigDecimal are reflected on the content of this Any.
Overrides:
insert_Principal in interface Any

insert_Streamable

public void insert_Streamable(Streamable x)
Sets the value to the value, encapsulated in this holder. This implementation uses direct assignment, so the later alterations of that streamable are reflected on the content of this Any.
Overrides:
insert_Streamable in interface Any

insert_TypeCode

public void insert_TypeCode(TypeCode typecode)
Insert the typecode into this Any
Overrides:
insert_TypeCode in interface Any
Parameters:
typecode - the typecode to insert.

insert_Value

public void insert_Value(Serializable x)
Overrides:
insert_Value in interface Any

insert_Value

public void insert_Value(Serializable x,
                         TypeCode c_typecode)
Overrides:
insert_Value in interface Any

insert_any

public void insert_any(Any an_any)
Insert another Any into this Any. This implementation uses direct assignment, so the later alterations of that Any are reflected on the content of this Any.
Overrides:
insert_any in interface Any

insert_boolean

public void insert_boolean(boolean x)
Overrides:
insert_boolean in interface Any

insert_char

public void insert_char(char x)
Overrides:
insert_char in interface Any

insert_double

public void insert_double(double x)
Overrides:
insert_double in interface Any

insert_fixed

public void insert_fixed(BigDecimal x)
Inserts the CORBA fixed, setting the typecode by example of the currently passed value. This implementation uses direct assignment, so the later alterations of that BigDecimal are reflected on the content of this Any, including the typecode.
Overrides:
insert_fixed in interface Any

insert_fixed

public void insert_fixed(BigDecimal x,
                         TypeCode x_typecode)
Inserts the CORBA fixed, setting the typecode explicitly. This implementation uses direct assignment, so the later alterations of that BigDecimal are reflected on the content of this Any.
Overrides:
insert_fixed in interface Any

insert_float

public void insert_float(float x)
Overrides:
insert_float in interface Any

insert_long

public void insert_long(int x)
Overrides:
insert_long in interface Any

insert_longlong

public void insert_longlong(long x)
Overrides:
insert_longlong in interface Any

insert_octet

public void insert_octet(byte x)
Overrides:
insert_octet in interface Any

insert_short

public void insert_short(short x)
Overrides:
insert_short in interface Any

insert_string

public void insert_string(String x)
Overrides:
insert_string in interface Any

insert_ulong

public void insert_ulong(int x)
Overrides:
insert_ulong in interface Any

insert_ulonglong

public void insert_ulonglong(long x)
Overrides:
insert_ulonglong in interface Any

insert_ushort

public void insert_ushort(short x)
Overrides:
insert_ushort in interface Any

insert_wchar

public void insert_wchar(char x)
Overrides:
insert_wchar in interface Any

insert_wstring

public void insert_wstring(String x)
Overrides:
insert_wstring in interface Any

orb

public ORB orb()
Return the associated orb.

read_value

public void read_value(InputStream input,
                       TypeCode a_type)
            throws MARSHAL
Read the value of the given type from the given stream.
Overrides:
read_value in interface Any
Parameters:
input - a stream to read from.
a_type - a typecode of the value to read.

setOrb

public void setOrb(ORB an_orb)
Set the associated orb.

type

public TypeCode type()
Overrides:
type in interface Any

type

public void type(TypeCode valueTypeCode)
Explicitly set the typecode of the value to the given type.
Overrides:
type in interface Any
Parameters:
valueTypeCode - the typecode of the value.

write_value

public void write_value(OutputStream output)
Overrides:
write_value in interface Any

gnuAny.java -- Copyright (C) 2005 Free Software Foundation, Inc. This file is part of GNU Classpath. GNU Classpath is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2, or (at your option) any later version. GNU Classpath is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with GNU Classpath; see the file COPYING. If not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. Linking this library statically or dynamically with other modules is making a combined work based on this library. Thus, the terms and conditions of the GNU General Public License cover the whole combination. As a special exception, the copyright holders of this library give you permission to link this library with independent modules to produce an executable, regardless of the license terms of these independent modules, and to copy and distribute the resulting executable under terms of your choice, provided that you also meet, for each linked independent module, the terms and conditions of the license of that module. An independent module is a module which is not derived from or based on this library. If you modify this library, you may extend this exception to your version of the library, but you are not obligated to do so. If you do not wish to do so, delete this exception statement from your version.