3 /** Class IoTRMITypes is a class that provides type translations.
5 * It stores C++ and Java types.
7 * @author Rahmadi Trimananda <rtrimana @ uci.edu>
12 import java.util.HashMap;
15 public class IoTRMITypes {
18 * Primitive data types in Java
20 public final static String[] primitivesJava = new String[] {
37 "Character", // 2 bytes
38 "string", // indefinite
39 "String", // indefinite
45 * Primitive data types in C++ to map the primitives list
47 public final static String[] primitivesCplus = new String[] {
65 "string", // indefinite
66 "string", // indefinite
72 * Primitive sizes in Java - Long is 8 bytes and char is 2 bytes
74 public final static Integer[] primitivesJavaSizes = new Integer[] {
76 1, 1, 2, 2, 4, 4, 8, 8, 4, 4, 8, 8, 1, 1, 2, 2, -1, -1, 0
81 * Primitive sizes in Cplus - Long is 4 bytes and char is 1 byte
83 public final static Integer[] primitivesCplusSizes = new Integer[] {
85 1, 1, 2, 2, 4, 4, 4, 4, 4, 4, 8, 8, 1, 1, 1, 1, -1, -1, 0
90 * Non-primitive Java data types
92 public final static String[] nonPrimitivesJava = new String[] {
104 * Non-primitive C++ data types
106 public final static String[] nonPrimitivesCplus = new String[] {
121 // Inserting array members into a Map object
122 // that maps arrKey to arrVal objects
123 public static void arraysToMap(Map<String,String> map, String[] arrKey, String[] arrVal) {
125 for(int i = 0; i < arrKey.length; i++) {
127 map.put(arrKey[i], arrVal[i]);
131 // Inserting array members into a Map object
132 // that maps arrKey to arrVal objects
133 public static void arraysToMap(Map<String,Integer> map, String[] arrKey, Integer[] arrVal) {
135 for(int i = 0; i < arrKey.length; i++) {
137 map.put(arrKey[i], arrVal[i]);
141 // Inserting array members into a Map object
142 // that maps arrKey to arrVal objects
143 public static void arraysToMap(Map<Object,Object> map, Object[] arrKey, Object[] arrVal) {
145 for(int i = 0; i < arrKey.length; i++) {
147 map.put(arrKey[i], arrVal[i]);