public class DeferredRunnable extends java.lang.Object implements java.lang.Comparable<DeferredRunnable>
Runnable
instancesConstructor 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) |
boolean |
isCompleted() |
boolean |
run()
Attempts to run the deferred
Runnable |
public boolean run()
Runnable
public boolean isCompleted()
public void cancel()
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>