OnJava8-Examples/concurrency/IntGenerator.java

11 lines
323 B
Java
Raw Normal View History

2015-04-20 15:36:01 -07:00
//: concurrency/IntGenerator.java
2015-05-29 14:18:51 -07:00
// <20>2015 MindView LLC: see Copyright.txt
2015-04-20 15:36:01 -07:00
public abstract class IntGenerator {
private volatile boolean canceled = false;
public abstract int next();
// Allow this to be canceled:
public void cancel() { canceled = true; }
public boolean isCanceled() { return canceled; }
} ///:~