3 import java.util.ArrayList;
4 import java.util.Arrays;
6 public class TestClass implements TestClassInterface {
13 private String stringC;
14 private List<CallBackInterfaceWithCallBack> cblist;
24 cblist = new ArrayList<CallBackInterfaceWithCallBack>();
28 public TestClass(int _int, float _float, String _string) {
33 cblist = new ArrayList<CallBackInterfaceWithCallBack>();
38 //public void registerCallback(CallBackInterface _cb) {
39 public void registerCallback(CallBackInterfaceWithCallBack _cb) {
42 System.out.println("Registering callback object!");
46 public void registerCallbackArray(CallBackInterfaceWithCallBack _cb[]) {
48 for (CallBackInterfaceWithCallBack cb : _cb) {
50 System.out.println("Registering callback objects in array!");
55 public void registerCallbackList(List<CallBackInterfaceWithCallBack> _cb) {
57 for (CallBackInterfaceWithCallBack cb : _cb) {
59 System.out.println("Registering callback objects in list!");
64 public void registerCallbackComplex(int in, List<CallBackInterfaceWithCallBack> _cb, double db) {
66 for (CallBackInterfaceWithCallBack cb : _cb) {
68 System.out.println("Registering callback objects in list!");
71 System.out.println("Integer: " + in);
72 System.out.println("Double: " + db);
76 public int callBack() {
79 for (CallBackInterfaceWithCallBack cb : cblist) {
80 sum = sum + cb.printInt();
87 public byte getByte(byte in) {
93 public short getShort(short in) {
99 public long getLong(long in) {
105 public float getFloat(float in) {
111 public double getDouble(double in) {
117 public boolean getBoolean(boolean in) {
123 public char getChar(char in) {
130 public byte[] getByteArray(byte[] in) {
136 public short[] getShortArray(short[] in) {
142 public long[] getLongArray(long[] in) {
148 public float[] getFloatArray(float[] in) {
154 public double[] getDoubleArray(double[] in) {
160 public boolean[] getBooleanArray(boolean[] in) {
166 public char[] getCharArray(char[] in) {
173 public List<Byte> getByteList(List<Byte> in) {
179 public List<Short> getShortList(List<Short> in) {
185 public List<Long> getLongList(List<Long> in) {
191 public List<Float> getFloatList(List<Float> in) {
197 public List<Double> getDoubleList(List<Double> in) {
203 public List<Boolean> getBooleanList(List<Boolean> in) {
209 public List<Character> getCharList(List<Character> in) {
222 public void setA(int _int) {
228 public void setB(float _float) {
234 public void setC(String _string) {
241 public Enum handleEnum(Enum en) {
243 System.out.println("Enum: " + en);
249 public Enum[] handleEnumArray(Enum[] en) {
252 System.out.println("Enum: " + e);
259 public List<Enum> handleEnumList(List<Enum> en) {
262 System.out.println("Enum: " + e);
269 public Enum handleEnumComplex(Enum en, int i, char c) {
271 System.out.println("Enum: " + en);
272 System.out.println("Integer: " + i);
273 System.out.println("Char: " + c);
279 public Enum[] handleEnumComplex2(Enum[] en, int in, char c) {
282 System.out.println("Enum: " + e);
284 System.out.println("Integer: " + in);
285 System.out.println("Char: " + c);
292 public Struct handleStruct(Struct str) {
294 System.out.println("Name: " + str.name);
295 System.out.println("Value: " + str.value);
296 System.out.println("Year: " + str.year);
299 Struct test = new Struct();
300 test.name = "Anonymous";
310 public Struct[] handleStructArray(Struct str[]) {
312 for (Struct st : str) {
313 System.out.println("Name: " + st.name);
314 System.out.println("Value: " + st.value);
315 System.out.println("Year: " + st.year);
318 Struct test = new Struct();
319 test.name = "Anonymous";
329 public List<Struct> handleStructList(List<Struct> str) {
331 for (Struct st : str) {
332 System.out.println("Name: " + st.name);
333 System.out.println("Value: " + st.value);
334 System.out.println("Year: " + st.year);
337 Struct test = new Struct();
348 public Struct handleStructComplex(int in, char c, Struct str) {
350 System.out.println("Name: " + str.name);
351 System.out.println("Value: " + str.value);
352 System.out.println("Year: " + str.year);
354 System.out.println("Integer: " + in);
355 System.out.println("Char: " + c);
357 Struct test = new Struct();
358 test.name = "Anonymous";
368 public List<Struct> handleStructComplex2(int in, char c, Struct str[]) {
370 for (Struct st : str) {
371 System.out.println("Name: " + st.name);
372 System.out.println("Value: " + st.value);
373 System.out.println("Year: " + st.year);
376 System.out.println("Integer: " + in);
377 System.out.println("Char: " + c);
379 return new ArrayList<Struct>(Arrays.asList(str));
384 public String sumArray(String[] newA) {
387 for (String i : newA)
393 public int setAndGetA(int newA) {
400 public int setACAndGetA(String newC, int newA) {