private int intA;
private float floatB;
private String stringC;
+ private List<CallBackInterfaceWithCallBack> cblist;
/**
* Constructors
}
+ // Callback
+ //public void registerCallback(CallBackInterface _cb) {
+ public void registerCallback(CallBackInterfaceWithCallBack _cb) {
+
+ cblist.add(_cb);
+ System.out.println("Registering callback object!");
+ }
+
+
+ /*public void registerCallback(CallBackInterfaceWithCallBack[] _cb) {
+
+ for (CallBackInterfaceWithCallBack cb : _cb) {
+ cblist.add(cb);
+ System.out.println("Registering callback object!");
+ }
+ }*/
+
+
+ public int callBack() {
+
+ int sum = 0;
+ for (CallBackInterfaceWithCallBack cb : cblist) {
+ sum = sum + cb.printInt();
+ }
+ return sum;
+ }
+
+
+ // Single variables
public byte getByte(byte in) {
return in;
}
+ // Arrays
+ public byte[] getByteArray(byte[] in) {
+
+ return in;
+ }
+
+
+ public short[] getShortArray(short[] in) {
+
+ return in;
+ }
+
+
+ public long[] getLongArray(long[] in) {
+
+ return in;
+ }
+
+
+ public float[] getFloatArray(float[] in) {
+
+ return in;
+ }
+
+
+ public double[] getDoubleArray(double[] in) {
+
+ return in;
+ }
+
+
+ public boolean[] getBooleanArray(boolean[] in) {
+
+ return in;
+ }
+
+
+ public char[] getCharArray(char[] in) {
+
+ return in;
+ }
+
+
+ // Lists
+ public List<Byte> getByteList(List<Byte> in) {
+
+ return in;
+ }
+
+
+ public List<Short> getShortList(List<Short> in) {
+
+ return in;
+ }
+
+
+ public List<Long> getLongList(List<Long> in) {
+
+ return in;
+ }
+
+
+ public List<Float> getFloatList(List<Float> in) {
+
+ return in;
+ }
+
+
+ public List<Double> getDoubleList(List<Double> in) {
+
+ return in;
+ }
+
+
+ public List<Boolean> getBooleanList(List<Boolean> in) {
+
+ return in;
+ }
+
+
+ public List<Character> getCharList(List<Character> in) {
+
+ return in;
+ }
+
+
+ // Other functions
public int getA() {
return intA;
}
+ // Enum
+ public Enum handleEnum(Enum en) {
+
+ System.out.println("Enum: " + en);
+
+ return en;
+ }
+
+
+ public Enum[] handleEnumArray(Enum[] en) {
+
+ for (Enum e : en) {
+ System.out.println("Enum: " + e);
+ }
+
+ return en;
+ }
+
+
+ public List<Enum> handleEnumList(List<Enum> en) {
+
+ for (Enum e : en) {
+ System.out.println("Enum: " + e);
+ }
+
+ return en;
+ }
+
+
// Getters
public String sumArray(String[] newA) {