All Downloads are FREE. Search and download functionalities are using the official Maven repository.

com.fathzer.jchess.uci.LongRunningTask Maven / Gradle / Ivy

There is a newer version: 2.0.0
Show newest version
package com.fathzer.jchess.uci;

import java.util.concurrent.atomic.AtomicBoolean;

/** A task that will be executed in the background of UCI interface.
 * @param  The result of the task
 */
public abstract class LongRunningTask {
	private final AtomicBoolean stopped;
	
	protected LongRunningTask() {
		stopped = new AtomicBoolean();
	}

	public abstract T get();

	public boolean isStopped() {
		return stopped.get();
	}
	
	public void stop() {
		stopped.set(true);
	}
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy