11 lines
323 B
Java
11 lines
323 B
Java
|
//: concurrency/IntGenerator.java
|
|||
|
// <20>2015 MindView LLC: see Copyright.txt
|
|||
|
|
|||
|
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; }
|
|||
|
} ///:~
|