Package org.onlab.util
Class PredictableExecutor.PickyFutureTask<T>
- java.lang.Object
-
- java.util.concurrent.FutureTask<T>
-
- org.onlab.util.PredictableExecutor.PickyFutureTask<T>
-
- Type Parameters:
T- result type.
- All Implemented Interfaces:
Runnable,Future<T>,RunnableFuture<T>,PredictableExecutor.PickyTask
- Enclosing class:
- PredictableExecutor
public static class PredictableExecutor.PickyFutureTask<T> extends FutureTask<T> implements PredictableExecutor.PickyTask
AFutureTaskimplementingPredictableExecutor.PickyTask.Note: if the wrapped
CallableorRunnablewas an instance ofPredictableExecutor.PickyTask, it will usePredictableExecutor.PickyTask.hint()value, if not useObject.hashCode().
-
-
Constructor Summary
Constructors Constructor Description PickyFutureTask(Runnable runnable, T value)Same asFutureTask(Runnable, Object).PickyFutureTask(Callable<T> callable)Same asFutureTask(Callable).
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description inthint()Returns hint for choosing which Thread to run this task on.-
Methods inherited from class java.util.concurrent.FutureTask
cancel, done, get, get, isCancelled, isDone, run, runAndReset, set, setException, toString
-
-
-
-
Constructor Detail
-
PickyFutureTask
public PickyFutureTask(Runnable runnable, T value)
Same asFutureTask(Runnable, Object).- Parameters:
runnable- work to dovalue- result
-
PickyFutureTask
public PickyFutureTask(Callable<T> callable)
Same asFutureTask(Callable).- Parameters:
callable- work to be done
-
-
Method Detail
-
hint
public int hint()
Description copied from interface:PredictableExecutor.PickyTaskReturns hint for choosing which Thread to run this task on.- Specified by:
hintin interfacePredictableExecutor.PickyTask- Returns:
- hint value
-
-