public class DeferredRunnable extends java.lang.Object implements java.lang.Comparable<DeferredRunnable>
Runnable instances| Constructor and Description |
|---|
DeferredRunnable() |
| Modifier and Type | Method and Description |
|---|---|
static DeferredRunnable |
allocate(java.lang.Runnable runnable,
float duration)
Allocates a new
DeferredRunnable instance from the instance pool
and assigns the duration and Runnable to it |
void |
cancel() |
int |
compareTo(DeferredRunnable o) |
int |
getDeferId() |
boolean |
isCompleted() |
boolean |
run()
Attempts to run the deferred
Runnable |
public boolean run()
Runnablepublic boolean isCompleted()
public void cancel()
public int getDeferId()
public static DeferredRunnable allocate(java.lang.Runnable runnable, float duration)
DeferredRunnable instance from the instance pool
and assigns the duration and Runnable to itrunnable - The Runnable to deferduration - The amount of time to defer execution byDeferredRunnable instancepublic int compareTo(DeferredRunnable o)
compareTo in interface java.lang.Comparable<DeferredRunnable>