OnJava8-Examples/concurrency/IntSupplier.java
2015-11-03 12:00:44 -08:00

10 lines
273 B
Java

// concurrency/IntSupplier.java
public abstract class IntSupplier {
private volatile boolean canceled = false;
public abstract int next();
// Allow this to be canceled:
public void cancel() { canceled = true; }
public boolean isCanceled() { return canceled; }
}