2 package saccubus.converter;
4 import saccubus.ConvertStopFlag;
5 import saccubus.net.TextProgressListener;
11 public abstract class AbstractCommand {
13 private final TextProgressListener listener;
14 private final ConvertStopFlag StopFlag;
16 public AbstractCommand(TextProgressListener listener, ConvertStopFlag StopFlag) {
17 this.listener = listener;
18 this.StopFlag = StopFlag;
21 protected void stopFlagReturn() throws InterruptedException {
22 if (getStopFlag().needStop()) {
23 throw new InterruptedException("中止しました。");
27 protected void sendText(String text) {
31 protected void sendText(String text, boolean debugOut) {
32 getListener().setText(text);
34 System.out.println(text);
39 * @return the listener
41 protected TextProgressListener getListener() {
46 * @return the StopFlag
48 protected ConvertStopFlag getStopFlag() {