T - result type.public static class PredictableExecutor.PickyFutureTask<T> extends java.util.concurrent.FutureTask<T> implements PredictableExecutor.PickyTask
FutureTask implementing PredictableExecutor.PickyTask.
Note: if the wrapped Callable or Runnable was an instance of
PredictableExecutor.PickyTask, it will use PredictableExecutor.PickyTask.hint() value, if not use Object.hashCode().
| Constructor and Description |
|---|
PickyFutureTask(java.util.concurrent.Callable<T> callable)
Same as
FutureTask.FutureTask(Callable). |
PickyFutureTask(java.lang.Runnable runnable,
T value)
Same as
FutureTask.FutureTask(Runnable, Object). |
| Modifier and Type | Method and Description |
|---|---|
int |
hint()
Returns hint for choosing which Thread to run this task on.
|
public PickyFutureTask(java.lang.Runnable runnable,
T value)
FutureTask.FutureTask(Runnable, Object).runnable - work to dovalue - resultpublic PickyFutureTask(java.util.concurrent.Callable<T> callable)
FutureTask.FutureTask(Callable).callable - work to be donepublic int hint()
PredictableExecutor.PickyTaskhint in interface PredictableExecutor.PickyTask