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 System.out.println("Callback called!");
80 for (CallBackInterfaceWithCallBack cb : cblist) {
81 sum = sum + cb.printInt();
82 cb.needCallback(this);
89 public byte getByte(byte in) {
95 public short getShort(short in) {
101 public long getLong(long in) {
107 public float getFloat(float in) {
113 public double getDouble(double in) {
119 public boolean getBoolean(boolean in) {
125 public char getChar(char in) {
132 public byte[] getByteArray(byte[] in) {
138 public short[] getShortArray(short[] in) {
144 public long[] getLongArray(long[] in) {
150 public float[] getFloatArray(float[] in) {
156 public double[] getDoubleArray(double[] in) {
162 public boolean[] getBooleanArray(boolean[] in) {
168 public char[] getCharArray(char[] in) {
175 public List<Byte> getByteList(List<Byte> in) {
181 public List<Short> getShortList(List<Short> in) {
187 public List<Long> getLongList(List<Long> in) {
193 public List<Float> getFloatList(List<Float> in) {
199 public List<Double> getDoubleList(List<Double> in) {
205 public List<Boolean> getBooleanList(List<Boolean> in) {
211 public List<Character> getCharList(List<Character> in) {
224 public void setA(int _int) {
230 public void setB(float _float) {
236 public void setC(String _string) {
243 public Enum handleEnum(Enum en) {
245 System.out.println("Enum: " + en);
251 public Enum[] handleEnumArray(Enum[] en) {
254 System.out.println("Enum: " + e);
261 public List<Enum> handleEnumList(List<Enum> en) {
264 System.out.println("Enum: " + e);
271 public Enum handleEnumComplex(Enum en, int i, char c) {
273 System.out.println("Enum: " + en);
274 System.out.println("Integer: " + i);
275 System.out.println("Char: " + c);
281 public Enum[] handleEnumComplex2(Enum[] en, int in, char c) {
284 System.out.println("Enum: " + e);
286 System.out.println("Integer: " + in);
287 System.out.println("Char: " + c);
293 public Enum[] handleEnumTwo(Enum en1[], Enum en2[]) {
296 System.out.println("Enum1: " + e);
299 System.out.println("Enum2: " + e);
306 public Enum[] handleEnumThree(Enum en1[], Enum en2[], List<Struct> str1, List<Struct> str2) {
309 System.out.println("Enum1: " + e);
312 System.out.println("Enum2: " + e);
320 public Struct handleStruct(Struct str) {
322 System.out.println("Name: " + str.name);
323 System.out.println("Value: " + str.value);
324 System.out.println("Year: " + str.year);
327 Struct test = new Struct();
328 test.name = "Anonymous";
338 public Struct[] handleStructArray(Struct str[]) {
340 for (Struct st : str) {
341 System.out.println("Name: " + st.name);
342 System.out.println("Value: " + st.value);
343 System.out.println("Year: " + st.year);
346 Struct test = new Struct();
347 test.name = "Anonymous";
357 public List<Struct> handleStructList(List<Struct> str) {
359 for (Struct st : str) {
360 System.out.println("Name: " + st.name);
361 System.out.println("Value: " + st.value);
362 System.out.println("Year: " + st.year);
365 Struct test = new Struct();
376 public Struct handleStructComplex(int in, char c, Struct str) {
378 System.out.println("Name: " + str.name);
379 System.out.println("Value: " + str.value);
380 System.out.println("Year: " + str.year);
382 System.out.println("Integer: " + in);
383 System.out.println("Char: " + c);
385 Struct test = new Struct();
386 test.name = "Anonymous";
396 public List<Struct> handleStructComplex2(int in, char c, Struct str[]) {
398 for (Struct st : str) {
399 System.out.println("Name: " + st.name);
400 System.out.println("Value: " + st.value);
401 System.out.println("Year: " + st.year);
404 System.out.println("Integer: " + in);
405 System.out.println("Char: " + c);
407 return new ArrayList<Struct>(Arrays.asList(str));
411 public Enum[] handleEnumStruct(Enum en[], List<Struct> str, char c) {
413 for (Struct st : str) {
414 System.out.println("Name: " + st.name);
415 System.out.println("Value: " + st.value);
416 System.out.println("Year: " + st.year);
419 System.out.println("Char: " + c);
425 public List<Struct> handleStructTwo(List<Struct> str1, List<Struct> str2) {
427 for (Struct st : str1) {
428 System.out.println("Name: " + st.name);
429 System.out.println("Value: " + st.value);
430 System.out.println("Year: " + st.year);
437 public List<Struct> handleStructThree(List<Struct> str1, List<Struct> str2, List<Struct> str3) {
439 for (Struct st : str1) {
440 System.out.println("Name: " + st.name);
441 System.out.println("Value: " + st.value);
442 System.out.println("Year: " + st.year);
449 public Enum[] handleAll(Enum en[], List<Struct> str, char c, List<CallBackInterfaceWithCallBack> _cb) {
451 for (CallBackInterfaceWithCallBack cb : _cb) {
453 System.out.println("Registering callback objects in list!");
456 for (Struct st : str) {
457 System.out.println("Name: " + st.name);
458 System.out.println("Value: " + st.value);
459 System.out.println("Year: " + st.year);
462 System.out.println("Char: " + c);
468 public Enum[] handleCallbackEnum(Enum en[], char c, List<CallBackInterfaceWithCallBack> _cb) {
470 for (CallBackInterfaceWithCallBack cb : _cb) {
472 System.out.println("Registering callback objects in list!");
475 System.out.println("Char: " + c);
481 public Enum[] handleAllTwo(Enum en1[], Enum en2[], List<Struct> str1, List<Struct> str2, char c, List<CallBackInterfaceWithCallBack> _cb1, List<CallBackInterfaceWithCallBack> _cb2) {
483 for (CallBackInterfaceWithCallBack cb : _cb1) {
485 System.out.println("Registering callback objects in list!");
488 for (Struct st : str1) {
489 System.out.println("Name: " + st.name);
490 System.out.println("Value: " + st.value);
491 System.out.println("Year: " + st.year);
494 System.out.println("Char: " + c);
501 public String sumArray(String[] newA) {
504 for (String i : newA)
510 public int setAndGetA(int newA) {
517 public int setACAndGetA(String newC, int newA) {