Package org.jmock.lib.concurrent
Class DeterministicScheduler.ScheduledTask<T>
java.lang.Object
org.jmock.lib.concurrent.DeterministicScheduler.ScheduledTask<T>
- All Implemented Interfaces:
Comparable<Delayed>
,Runnable
,Delayed
,Future<T>
,ScheduledFuture<T>
- Enclosing class:
DeterministicScheduler
private final class DeterministicScheduler.ScheduledTask<T>
extends Object
implements ScheduledFuture<T>, Runnable
-
Nested Class Summary
Nested classes/interfaces inherited from interface java.util.concurrent.Future
Future.State
-
Field Summary
Fields -
Constructor Summary
ConstructorsConstructorDescriptionScheduledTask
(long repeatDelay, Runnable command) ScheduledTask
(Runnable command) ScheduledTask
(Callable<T> command) -
Method Summary
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
Methods inherited from interface java.util.concurrent.Future
exceptionNow, resultNow, state
-
Field Details
-
repeatDelay
public final long repeatDelay -
command
-
isCancelled
private boolean isCancelled -
isDone
private boolean isDone -
futureResult
-
failure
-
-
Constructor Details
-
ScheduledTask
-
ScheduledTask
-
ScheduledTask
-
-
Method Details
-
toString
-
repeats
public boolean repeats() -
getDelay
-
compareTo
- Specified by:
compareTo
in interfaceComparable<T>
-
cancel
public boolean cancel(boolean mayInterruptIfRunning) -
get
- Specified by:
get
in interfaceFuture<T>
- Throws:
InterruptedException
ExecutionException
-
get
public T get(long timeout, TimeUnit unit) throws InterruptedException, ExecutionException, TimeoutException - Specified by:
get
in interfaceFuture<T>
- Throws:
InterruptedException
ExecutionException
TimeoutException
-
isCancelled
public boolean isCancelled()- Specified by:
isCancelled
in interfaceFuture<T>
-
isDone
public boolean isDone() -
run
public void run()
-