Module MaterialFX
Class ReusableScheduledExecutor
java.lang.Object
io.github.palexdev.materialfx.utils.others.ReusableScheduledExecutor
This class wraps a
ScheduledExecutorService
to make it reusable by keeping
a reference to the ScheduledFuture
.-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoid
cancel()
Cancels the task by callingFuture.cancel(boolean)
with false as argument.void
Cancels the task by callingFuture.cancel(boolean)
with true as argument.<V> ScheduledFuture<V>
scheduleAtFixedRate
(Runnable command, long initialDelay, long period, TimeUnit unit) scheduleWithFixedDelay
(Runnable command, long initialDelay, long delay, TimeUnit unit)
-
Constructor Details
-
ReusableScheduledExecutor
-
-
Method Details
-
cancel
public void cancel()Cancels the task by callingFuture.cancel(boolean)
with false as argument. -
cancelNow
public void cancelNow()Cancels the task by callingFuture.cancel(boolean)
with true as argument. -
schedule
-
schedule
-
scheduleAtFixedRate
public ScheduledFuture<?> scheduleAtFixedRate(Runnable command, long initialDelay, long period, TimeUnit unit) -
scheduleWithFixedDelay
public ScheduledFuture<?> scheduleWithFixedDelay(Runnable command, long initialDelay, long delay, TimeUnit unit) -
getService
-