Use of FutureTask
I have a class which implements Runnable and has a separate method for returning a result (few different methods because you can get various results) .. there is also some stuff that has to be done when cancelling/interrupting the running of this.
Now, I've been asked to use FutureTask
This is where I am stuck. I've read the tutorials, searched Google, but I can't find information on how to use Runnable classes with FutureTask - especially where I need to do more than the standard FutureTask Cancel method and where in different circumstances have to return different result types.
I was also confused about the constructor
FutureTask(Runnable runnable, V result)
When I read the Java 1.5 code all this does is set the value of result to what is passed in the constructor... but how can that be when a result can't be set until you actually call runnable.run() method?
My first thought was to create a class which extends FutureTask and use the FutureTask(Runnable runnable, V result) constructor but then I can't figure out the rest.

