transcendental-lisp/test/terminal/FlushListener.java
Mike Cifelli 38ab1144fb Clean up terminal code and unit tests
The terminal unit tests were updated so that they don't rely on an
arbitrary delay.
2017-03-19 12:54:35 -04:00

38 lines
756 B
Java

package terminal;
import com.googlecode.lanterna.TerminalSize;
import com.googlecode.lanterna.terminal.Terminal;
import com.googlecode.lanterna.terminal.virtual.VirtualTerminalListener;
public class FlushListener implements VirtualTerminalListener {
private int flushCount;
public FlushListener() {
this.flushCount = 0;
}
public int getFlushCount() {
return flushCount;
}
public void resetFlushCount() {
flushCount = 0;
}
@Override
public void onResized(Terminal terminal, TerminalSize newSize) {}
@Override
public synchronized void onFlush() {
flushCount++;
notify();
}
@Override
public void onBell() {}
@Override
public void onClose() {}
}