T
- type of the resultpublic final class ScheduledTask<T> extends Object implements ScheduledFuture<T>
Constructor and Description |
---|
ScheduledTask(Callable<T> callable,
long delay) |
ScheduledTask(Callable<T> callable,
long delay,
long period) |
Modifier and Type | Method and Description |
---|---|
boolean |
cancel(boolean mayInterruptIfRunning) |
int |
compareTo(Delayed o) |
void |
execute() |
T |
get() |
T |
get(long timeout,
TimeUnit unit) |
Callable<T> |
getCallable() |
long |
getDelay(TimeUnit unit) |
long |
getPeriod() |
boolean |
isCancelled() |
boolean |
isDone() |
boolean |
isPeriodic() |
public boolean isPeriodic()
public long getPeriod()
public void execute()
public int compareTo(Delayed o)
compareTo
in interface Comparable<Delayed>
public boolean cancel(boolean mayInterruptIfRunning)
public boolean isCancelled()
isCancelled
in interface Future<T>
public T get() throws InterruptedException, ExecutionException
get
in interface Future<T>
InterruptedException
ExecutionException
public T get(long timeout, @Nonnull TimeUnit unit) throws InterruptedException, ExecutionException, TimeoutException
get
in interface Future<T>
InterruptedException
ExecutionException
TimeoutException
Copyright © 2014–2024 The Apache Software Foundation. All rights reserved.