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 int callBack() {
67 for (CallBackInterfaceWithCallBack cb : cblist) {
68 sum = sum + cb.printInt();
75 public byte getByte(byte in) {
81 public short getShort(short in) {
87 public long getLong(long in) {
93 public float getFloat(float in) {
99 public double getDouble(double in) {
105 public boolean getBoolean(boolean in) {
111 public char getChar(char in) {
118 public byte[] getByteArray(byte[] in) {
124 public short[] getShortArray(short[] in) {
130 public long[] getLongArray(long[] in) {
136 public float[] getFloatArray(float[] in) {
142 public double[] getDoubleArray(double[] in) {
148 public boolean[] getBooleanArray(boolean[] in) {
154 public char[] getCharArray(char[] in) {
161 public List<Byte> getByteList(List<Byte> in) {
167 public List<Short> getShortList(List<Short> in) {
173 public List<Long> getLongList(List<Long> in) {
179 public List<Float> getFloatList(List<Float> in) {
185 public List<Double> getDoubleList(List<Double> in) {
191 public List<Boolean> getBooleanList(List<Boolean> in) {
197 public List<Character> getCharList(List<Character> in) {
210 public void setA(int _int) {
216 public void setB(float _float) {
222 public void setC(String _string) {
229 public Enum handleEnum(Enum en) {
231 System.out.println("Enum: " + en);
237 public Enum[] handleEnumArray(Enum[] en) {
240 System.out.println("Enum: " + e);
247 public List<Enum> handleEnumList(List<Enum> en) {
250 System.out.println("Enum: " + e);
257 public Enum handleEnumComplex(Enum en, int i, char c) {
259 System.out.println("Enum: " + en);
260 System.out.println("Integer: " + i);
261 System.out.println("Char: " + c);
267 public Enum[] handleEnumComplex2(Enum[] en, int in, char c) {
270 System.out.println("Enum: " + e);
272 System.out.println("Integer: " + in);
273 System.out.println("Char: " + c);
280 public Struct handleStruct(Struct str) {
282 System.out.println("Name: " + str.name);
283 System.out.println("Value: " + str.value);
284 System.out.println("Year: " + str.year);
287 Struct test = new Struct();
288 test.name = "Anonymous";
298 public Struct[] handleStructArray(Struct str[]) {
300 for (Struct st : str) {
301 System.out.println("Name: " + st.name);
302 System.out.println("Value: " + st.value);
303 System.out.println("Year: " + st.year);
306 Struct test = new Struct();
307 test.name = "Anonymous";
317 public List<Struct> handleStructList(List<Struct> str) {
319 for (Struct st : str) {
320 System.out.println("Name: " + st.name);
321 System.out.println("Value: " + st.value);
322 System.out.println("Year: " + st.year);
325 Struct test = new Struct();
336 public Struct handleStructComplex(int in, char c, Struct str) {
338 System.out.println("Name: " + str.name);
339 System.out.println("Value: " + str.value);
340 System.out.println("Year: " + str.year);
342 System.out.println("Integer: " + in);
343 System.out.println("Char: " + c);
345 Struct test = new Struct();
346 test.name = "Anonymous";
356 public List<Struct> handleStructComplex2(int in, char c, Struct str[]) {
358 for (Struct st : str) {
359 System.out.println("Name: " + st.name);
360 System.out.println("Value: " + st.value);
361 System.out.println("Year: " + st.year);
364 System.out.println("Integer: " + in);
365 System.out.println("Char: " + c);
367 return new ArrayList<Struct>(Arrays.asList(str));
372 public String sumArray(String[] newA) {
375 for (String i : newA)
381 public int setAndGetA(int newA) {
388 public int setACAndGetA(String newC, int newA) {