public final class CancelSupport extends Object
SchedulerTask canceling.
Recommended usage:
public class MyTask extends ParserResultTask {
private final CancelSupport cancel = CancelSupport.create(this);
public void run (T result, SchedulerEvent event) {
...
if (cancel.isCancelled()) {
return;
}
...
}
}
| Modifier and Type | Method and Description |
|---|---|
static CancelSupport |
create(SchedulerTask owner)
Creates a new instance of the
CancelSupport. |
boolean |
isCancelled()
Returns true if the owning task was canceled.
|
public boolean isCancelled()
@NonNull public static CancelSupport create(@NonNull SchedulerTask owner)
CancelSupport.owner - the owning SchedulerTaskCancelSupport