48 |
|
/** |
49 |
|
* A delayed or periodic action. |
50 |
|
*/ |
51 |
< |
public class DelayedTask extends CancellableTask implements Delayed { |
51 |
> |
public static class DelayedTask extends CancellableTask implements Delayed { |
52 |
|
private final long sequenceNumber; |
53 |
|
private final long time; |
54 |
|
private final long period; |
97 |
|
return 1; |
98 |
|
} |
99 |
|
|
100 |
– |
public boolean cancel(boolean mayInterruptIfRunning) { |
101 |
– |
if (!isDone()) |
102 |
– |
ScheduledExecutor.this.remove(this); |
103 |
– |
return super.cancel(mayInterruptIfRunning); |
104 |
– |
} |
105 |
– |
|
100 |
|
/** |
101 |
|
* Return true if this is a periodic (not a one-shot) action. |
102 |
|
*/ |
128 |
|
/** |
129 |
|
* A delayed result-bearing action. |
130 |
|
*/ |
131 |
< |
public class DelayedFutureTask<V> extends DelayedTask implements Future<V> { |
131 |
> |
public static class DelayedFutureTask<V> extends DelayedTask implements Future<V> { |
132 |
|
/** |
133 |
|
* Creates a Future that may trigger after the given delay. |
134 |
|
*/ |