Class FixedBiLateScheduler<A,B>
java.lang.Object
ml.karmaconfigs.api.common.timer.scheduler.worker.FixedBiLateScheduler<A,B>
- Type Parameters:
A- the A object consumerB- the B object consumer
- All Implemented Interfaces:
BiLateScheduler<A,B>,CancellableScheduler
This scheduler will run a task when X is completed
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidComplete the schedulervoidComplete the schedulerGet the A objectGet the B objectbooleanGet if the scheduler is cancelledbooleanGet if the scheduler is completedvoidCancel the schedulerwhenCancelled(Runnable action)Set the cancelled actionwhenComplete(Runnable action)Set the complete actionwhenComplete(BiConsumer<A,B> action)Set the complete actionwhenComplete(TriConsumer<A,B,Throwable> caughtAction)Set the complete actionMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface ml.karmaconfigs.api.common.timer.scheduler.BiLateScheduler
thenCompleteUnder
-
Constructor Details
-
FixedBiLateScheduler
public FixedBiLateScheduler()
-
-
Method Details
-
whenComplete
Set the complete action- Specified by:
whenCompletein interfaceBiLateScheduler<A,B>- Parameters:
action- the action to perform when the scheduler is completed- Returns:
- this instance
-
whenComplete
Set the complete action- Specified by:
whenCompletein interfaceBiLateScheduler<A,B>- Parameters:
action- the action to perform when the scheduler is completed- Returns:
- this instance
-
whenComplete
Set the complete action- Specified by:
whenCompletein interfaceBiLateScheduler<A,B>- Parameters:
caughtAction- the action to perform when the scheduler is completed- Returns:
- this instance
-
isCompleted
public boolean isCompleted()Get if the scheduler is completed- Specified by:
isCompletedin interfaceBiLateScheduler<A,B>- Returns:
- if the shcheduler is complete
-
getObject
Get the A object- Specified by:
getObjectin interfaceBiLateScheduler<A,B>- Returns:
- the A object
-
getSubObject
Get the B object- Specified by:
getSubObjectin interfaceBiLateScheduler<A,B>- Returns:
- the B object
-
complete
Complete the scheduler- Specified by:
completein interfaceBiLateScheduler<A,B>- Parameters:
target- the type A objectsubTarget- the type B object
-
complete
Complete the scheduler- Specified by:
completein interfaceBiLateScheduler<A,B>- Parameters:
target- the type A objectsubTarget- the type B objecterror- any error that has been thrown
-
whenCancelled
Set the cancelled action- Specified by:
whenCancelledin interfaceCancellableScheduler- Parameters:
action- the action to perform when the timer is cancelled- Returns:
- a cancellable instance of this
-
isCancelled
public boolean isCancelled()Get if the scheduler is cancelled- Specified by:
isCancelledin interfaceCancellableScheduler- Returns:
- if the scheduler is cancelled
-
setCancelled
public void setCancelled()Cancel the scheduler- Specified by:
setCancelledin interfaceCancellableScheduler
-