Testing for list/vector data types
[iot2.git] / iotjava / iotrmi / Java / basics / TestClass.java
1 import java.util.Set;
2 import java.util.List;
3 import java.util.ArrayList;
4
5 public class TestClass implements TestClassInterface {
6
7         /**
8          * Class Properties
9          */
10         private int intA;
11         private float floatB;
12         private String stringC;
13
14         /**
15          * Constructors
16          */
17         public TestClass() {
18
19                 intA = 1;
20                 floatB = 2;
21                 stringC = "345";
22         }
23
24
25         public TestClass(int _int, float _float, String _string) {
26
27                 intA = _int;
28                 floatB = _float;
29                 stringC = _string;
30         }
31
32
33         // Single variables
34         public byte getByte(byte in) {
35
36                 return in;
37         }
38
39
40         public short getShort(short in) {
41
42                 return in;
43         }
44
45
46         public long getLong(long in) {
47
48                 return in;
49         }
50
51
52         public float getFloat(float in) {
53
54                 return in;
55         }
56
57
58         public double getDouble(double in) {
59
60                 return in;
61         }
62
63
64         public boolean getBoolean(boolean in) {
65
66                 return in;
67         }
68
69
70         public char getChar(char in) {
71
72                 return in;
73         }
74
75
76         // Arrays
77         public byte[] getByteArray(byte[] in) {
78
79                 return in;
80         }
81
82
83         public short[] getShortArray(short[] in) {
84
85                 return in;
86         }
87
88
89         public long[] getLongArray(long[] in) {
90
91                 return in;
92         }
93
94
95         public float[] getFloatArray(float[] in) {
96
97                 return in;
98         }
99
100
101         public double[] getDoubleArray(double[] in) {
102
103                 return in;
104         }
105
106
107         public boolean[] getBooleanArray(boolean[] in) {
108
109                 return in;
110         }
111
112
113         public char[] getCharArray(char[] in) {
114
115                 return in;
116         }
117
118
119         // Lists
120         public List<Byte> getByteList(List<Byte> in) {
121
122                 return in;
123         }
124
125
126         public List<Short> getShortList(List<Short> in) {
127
128                 return in;
129         }
130
131
132         public List<Long> getLongList(List<Long> in) {
133
134                 return in;
135         }
136
137
138         public List<Float> getFloatList(List<Float> in) {
139
140                 return in;
141         }
142
143
144         public List<Double> getDoubleList(List<Double> in) {
145
146                 return in;
147         }
148
149
150         public List<Boolean> getBooleanList(List<Boolean> in) {
151
152                 return in;
153         }
154
155
156         public List<Character> getCharList(List<Character> in) {
157
158                 return in;
159         }
160
161
162         // Other functions
163         public int getA() {
164
165                 return intA;
166         }
167
168
169         public void setA(int _int) {
170
171                 intA = _int;
172         }
173
174
175         public void setB(float _float) {
176
177                 floatB = _float;
178         }
179
180
181         public void setC(String _string) {
182
183                 stringC = _string;
184         }
185
186
187         // Getters
188         public String sumArray(String[] newA) {
189
190                 String sum = "";
191                 for (String i : newA) 
192                         sum = sum + i;
193                 return sum;
194         }
195
196
197         public int setAndGetA(int newA) {
198
199                 intA = newA;
200                 return intA;
201         }
202
203
204         public int setACAndGetA(String newC, int newA) {
205
206                 stringC = newC;
207                 intA = newA;
208                 return intA;
209         }
210 }