OSDN Git Service

ソースコードをUTF-8化
[coroid/inqubus.git] / frontend / src / saccubus / converter / AbstractCommand.java
1 /* $Id$ */
2 package saccubus.converter;
3
4 import saccubus.ConvertStopFlag;
5 import saccubus.net.TextProgressListener;
6
7 /**
8  *
9  * @author yuki
10  */
11 public abstract class AbstractCommand {
12
13     private final TextProgressListener listener;
14     private final ConvertStopFlag StopFlag;
15
16     public AbstractCommand(TextProgressListener listener, ConvertStopFlag StopFlag) {
17         this.listener = listener;
18         this.StopFlag = StopFlag;
19     }
20
21     protected void stopFlagReturn() throws InterruptedException {
22         if (getStopFlag().needStop()) {
23             throw new InterruptedException("中止しました。");
24         }
25     }
26
27     protected void sendText(String text) {
28         getListener().setText(text);
29     }
30
31     /**
32      * @return the listener
33      */
34     protected TextProgressListener getListener() {
35         return listener;
36     }
37
38     /**
39      * @return the StopFlag
40      */
41     protected ConvertStopFlag getStopFlag() {
42         return StopFlag;
43     }
44 }