Created
September 15, 2012 19:20
-
-
Save arunma/3729377 to your computer and use it in GitHub Desktop.
FutureTask Runnable Adapter
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
static final class RunnableAdapter<T> implements Callable<T> { | |
final Runnable task; | |
final T result; | |
RunnableAdapter(Runnable task, T result) { | |
this.task = task; | |
this.result = result; | |
} | |
public T [More ...] call() { | |
task.run(); | |
return result; | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment