Testing struct (single object); fixing small bugs, etc.
[iot2.git] / iotjava / iotrmi / Java / basics / TestClass.java
index a7453a499a2d1fb8d4adc64d1d38fa31e34a824b..8844ffbaa12edd8c8e3805bc59a5bebb2b5eb50f 100644 (file)
@@ -242,6 +242,44 @@ public class TestClass implements TestClassInterface {
        }
 
 
+       // Struct
+       public Struct handleStruct(Struct str) {
+
+               System.out.println("Name: " + str.name);
+               System.out.println("Value: " + str.value);
+               System.out.println("Year: " + str.year);
+
+
+               Struct test = new Struct();
+               test.name = "Anonymous";
+               test.value = 1.33f;
+               test.year = 2016;
+
+               str = test;
+
+               return str;
+       }
+
+
+       /*public Struct[] handleStruct(Struct[] data) {
+
+               for (Struct str : data) {
+                       System.out.println("Name: " + str.name);
+                       System.out.println("Value: " + str.value);
+                       System.out.println("Year: " + str.year);
+               }
+
+               Struct test = new Struct();
+               test.name = "Anonymous";
+               test.value = 1.33f;
+               test.year = 2016;
+
+               data[0] = test;
+
+               return data;
+       }*/
+
+
        // Getters
        public String sumArray(String[] newA) {