O'Reilly logo

Java Enterprise in a Nutshell, Third Edition by William Crawford, Jim Farley

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Basic Data Types

IDL supports the basic data types shown in Table G-2. The table also shows the Java type that each is mapped to according to the standard IDL Java mapping. Note that there isn’t a standard mapping defined for the long double IDL type, because Java doesn’t have a basic data type that supports the precision required. Another important thing to note is that Java doesn’t support unsigned types, such as unsigned short. So you’ll see in the table that IDL short and unsigned short are both mapped to the Java short data type. You should be aware of this when writing implementations of IDL-generated Java interfaces, since it is up to you to either ensure that their values remain positive or deal with the fact that their values may in fact be set to negative values.

Table G-2. IDL basic data types, sizes, and Java mappings

IDL type specifier

Required size

Java data type

short

16 bits

short

long

32 bits

int

long long

64 bits

long

unsigned short

16 bits

short

unsigned long

32 bits

int

unsigned long long

64 bits

long

char

8 bits

char

wchar

Implementation-dependent

char

string

Unlimited

java.lang.String

string<size>

size chars

java.lang.String

wstring

Unlimited

java.lang.String

wstring<size>

size wchars

java.lang.String

boolean

Implementation-dependent

boolean

octet

8 bits

byte

Any

Implementation-dependent

org.omg.CORBA.Any

float

IEEE single precision

float

double

IEEE double precision

double

long double

IEEE double extended

Not supported

fixed

31 decimal digits

java.math.BigDecimal

Strings and Characters

There are two character types ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required