1 package rydeen;
2
3 import java.io.IOException;
4 import java.io.OutputStream;
5
6 /**
7 * 出力先を表すインターフェースです.
8 *
9 * @author Haruaki Tamada
10 */
11 public interface Destination{
12 /**
13 * クラス名から出力先を決定し,出力ストリームを返します.
14 * 返された出力ストリームは必要がなくなればcloseを呼び出して閉じてください.
15 */
16 public OutputStream getOutput(String className) throws IOException;
17
18 /**
19 * {@link ProcessTarget}から出力先を決定し,出力ストリームを返します.
20 * 返された出力ストリームは必要がなくなればcloseを呼び出して閉じてください.
21 */
22 public OutputStream getOutput(ProcessTarget target) throws IOException;
23
24 /**
25 * {@link #getOutput(ProcessTarget) <code>getOutput</code>}から出力先を取得し,
26 * ProcessTargetの内容をそのまま出力ストリームに書き出します.
27 */
28 public void output(ProcessTarget target) throws IOException;
29
30 /**
31 * この出力先を閉じます.
32 * このメソッドが呼び出された後は,{@link #getOutput(String)
33 * <code>getOutput</code>}, {@link #output <code>output</code>}
34 * メソッドは正常に処理しない場合があります.
35 */
36 public void close() throws IOException;
37
38 /**
39 * このメソッドが閉じられているかを返します.
40 * このメソッドがtrueを返す場合,他のメソッドの動作は保証されません.
41 * @return この出力先が閉じられていればtrue,出力可能であればfalseを返す.
42 */
43 public boolean isClosed();
44 }