public static class TimeScheduler3.Task
extends java.lang.Object
implements java.lang.Runnable, java.util.concurrent.Delayed, java.util.concurrent.Future
Modifier and Type | Field and Description |
---|---|
protected boolean |
cancelled |
protected long |
creation_time |
protected long |
delay |
protected boolean |
done |
protected java.lang.Runnable |
runnable |
Constructor and Description |
---|
Task(java.lang.Runnable runnable) |
Task(java.lang.Runnable runnable,
long initial_delay,
java.util.concurrent.TimeUnit unit) |
Modifier and Type | Method and Description |
---|---|
boolean |
cancel(boolean mayInterruptIfRunning) |
int |
compareTo(java.util.concurrent.Delayed o) |
java.lang.Object |
get() |
java.lang.Object |
get(long timeout,
java.util.concurrent.TimeUnit unit) |
long |
getDelay(java.util.concurrent.TimeUnit unit) |
java.lang.Runnable |
getRunnable() |
boolean |
isCancelled() |
boolean |
isDone() |
void |
run() |
java.lang.String |
toString() |
protected final java.lang.Runnable runnable
protected long creation_time
protected long delay
protected volatile boolean cancelled
protected volatile boolean done
public Task(java.lang.Runnable runnable)
public Task(java.lang.Runnable runnable, long initial_delay, java.util.concurrent.TimeUnit unit)
public java.lang.Runnable getRunnable()
public int compareTo(java.util.concurrent.Delayed o)
compareTo
in interface java.lang.Comparable<java.util.concurrent.Delayed>
public long getDelay(java.util.concurrent.TimeUnit unit)
getDelay
in interface java.util.concurrent.Delayed
public boolean cancel(boolean mayInterruptIfRunning)
cancel
in interface java.util.concurrent.Future
public boolean isCancelled()
isCancelled
in interface java.util.concurrent.Future
public boolean isDone()
isDone
in interface java.util.concurrent.Future
public java.lang.Object get() throws java.lang.InterruptedException, java.util.concurrent.ExecutionException
get
in interface java.util.concurrent.Future
java.lang.InterruptedException
java.util.concurrent.ExecutionException
public java.lang.Object get(long timeout, java.util.concurrent.TimeUnit unit) throws java.lang.InterruptedException, java.util.concurrent.ExecutionException, java.util.concurrent.TimeoutException
get
in interface java.util.concurrent.Future
java.lang.InterruptedException
java.util.concurrent.ExecutionException
java.util.concurrent.TimeoutException
public void run()
run
in interface java.lang.Runnable
public java.lang.String toString()
toString
in class java.lang.Object
Copyright © 1998-2020 Red Hat. All Rights Reserved.