2 package saccubus.converter;
4 import static org.apache.commons.lang.Validate.*;
5 import saccubus.ConvertStopFlag;
6 import saccubus.net.TextProgressListener;
12 public abstract class AbstractCommand {
14 private final TextProgressListener listener;
15 private final ConvertStopFlag StopFlag;
17 public AbstractCommand(TextProgressListener listener, ConvertStopFlag stopFlag) {
21 this.listener = listener;
22 this.StopFlag = stopFlag;
25 protected void stopFlagReturn() throws InterruptedException {
26 if (getStopFlag().needStop()) {
27 throw new InterruptedException("中止しました。");
31 protected void sendText(String text) {
32 getListener().setText(text);
36 * @return the listener
38 protected TextProgressListener getListener() {
43 * @return the StopFlag
45 protected ConvertStopFlag getStopFlag() {