next up previous contents index
Next: Calling Prolog from Java Up: External Language Interface with Previous: Installation   Contents   Index

Data conversion between Java and B-Prolog

The following table converts data from Java to Prolog and vice versa.
Java Prolog
Integer integer
Double real
Long integer
BigInteger integer
String atom
Object array list
Object $addr(I1,I2)
Notice that primitive data types in Java cannot be converted into Prolog.

The conversion between arrays and lists needs further explanation. A Java array of some type is converted into a list of elements of the corresponding converted type. For instance, an Integer array is converted into a list of integers. In contrast, a Prolog list, whatever type whose elements belong to, is converted into an array of Object type. When an array element is used as a specific type, it must be casted to the type.


next up previous contents index
Next: Calling Prolog from Java Up: External Language Interface with Previous: Installation   Contents   Index
Neng-Fa Zhou
1999-11-24