public class ExecuteWorker.ScheduleFutureImp extends Object implements ScheduledFuture
ScheduledFuture
waitAndDone()
so that program will wait until program doneModifier and Type | Method and Description |
---|---|
boolean |
cancel(boolean mayInterruptIfRunning) |
int |
compareTo(Delayed o) |
int |
compareTo(Object o) |
Object |
get()
this get will return 2 thing
CancellationException - if the task got cancel (ExecuteWorker.schedule(Runnable, int, int, int, TimeUnit, boolean) )
Null - if have another exception or Future.get() return object successfully
|
Object |
get(long timeout,
TimeUnit unit) |
long |
getDelay(TimeUnit unit) |
boolean |
isCancelled() |
boolean |
isDone() |
boolean |
waitAndDone()
wait until execution was done, and return the result in term of true/false
|
public boolean waitAndDone()
ExecuteWorker.schedule(Runnable, int, int, int, TimeUnit, boolean)
)public boolean cancel(boolean mayInterruptIfRunning)
public boolean isCancelled()
isCancelled
in interface Future
public Object get()
CancellationException
- if the task got cancel (ExecuteWorker.schedule(Runnable, int, int, int, TimeUnit, boolean)
)Null
- if have another exception or Future.get()
return object successfullyget
in interface Future
CancellationException
public Object get(long timeout, TimeUnit unit) throws InterruptedException, ExecutionException, TimeoutException
get
in interface Future
InterruptedException
ExecutionException
TimeoutException
public int compareTo(Delayed o)
public int compareTo(Object o)
compareTo
in interface Comparable<Delayed>
Copyright © 2017. All rights reserved.