jpower.core.Task Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of JPower Show documentation
Show all versions of JPower Show documentation
Powerful Library for the JVM
package jpower.core;
import jpower.core.internal.CancelStateTracker;
public interface Task extends Runnable
{
public default void run()
{
execute();
}
public void execute();
public default boolean isCancelled()
{
return CancelStateTracker.isCancelled(this);
}
public default void cancel()
{
CancelStateTracker.setCancelled(this, true);
}
public default void activate()
{
CancelStateTracker.setCancelled(this, false);
}
}