L
Lino Ferrentino
Maybe there are other methods... I use this:
public final class b_callbacks {
private b_callbacks(){
}
public static interface void_f_void{
public void f();
}
public static interface void_f_int{
public void f(int i);
}
}
----
when I want to use a function pointer
import b_callbacks.void_f_int;
private void_f_int my_callback;
my_callback = new void_f_int(){
public void f(int i){
//code
}
};
to call the callback
my_callback.f(42);
====
For each function pointer type we create an interface.
public final class b_callbacks {
private b_callbacks(){
}
public static interface void_f_void{
public void f();
}
public static interface void_f_int{
public void f(int i);
}
}
----
when I want to use a function pointer
import b_callbacks.void_f_int;
private void_f_int my_callback;
my_callback = new void_f_int(){
public void f(int i){
//code
}
};
to call the callback
my_callback.f(42);
====
For each function pointer type we create an interface.