Code example for ScheduledFuture

Methods: cancelisDone

0
        reschedule(); 
    } 
 
    public boolean cancel() { 
        try { 
            if (scheduledTask == null || scheduledTask.isDone()) {
                return true; 
            } 
            return scheduledTask.cancel(false);
        } finally { 
            scheduledTask = null;
        } 
    } 
 
    public void reschedule() { 
        if (scheduledTask == null || scheduledTask.cancel(false)) {
            scheduledTask = scheduler.schedule(r, timeoutMillis, TimeUnit.MILLISECONDS);
        } 
    } 
} 
Contextual code suggestions in your IDE  Get Codota for Java