net.argius.stu.io
クラス FilePrinter

java.lang.Object
  拡張net.argius.stu.io.FilePrinter
すべての実装インタフェース:
Printer

public final class FilePrinter
extends Object
implements Printer

ファイル「プリンタ」です。 出力先を任意のファイルに設定します。 ファイルは常に書き込みモードでオープンされます。


コンストラクタの概要
FilePrinter(File file)
          指定されたファイルに出力するプリンタを生成します。
FilePrinter(String file)
          指定されたファイルに出力するプリンタを生成します。
 
メソッドの概要
 void close()
          出力先を閉じます。
 void print(String message)
          文字列を出力します。
 void println(String message)
          文字列を1行出力します。
 
クラス java.lang.Object から継承したメソッド
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

コンストラクタの詳細

FilePrinter

public FilePrinter(File file)
            throws IOException
指定されたファイルに出力するプリンタを生成します。

パラメータ:
file - ファイル
例外:
IOException - ファイルオープンエラー

FilePrinter

public FilePrinter(String file)
            throws IOException
指定されたファイルに出力するプリンタを生成します。

パラメータ:
file - ファイルパス
例外:
IOException - ファイルオープンエラー
メソッドの詳細

print

public void print(String message)
文字列を出力します。

定義:
インタフェース Printer 内の print
パラメータ:
message - メッセージ

println

public void println(String message)
文字列を1行出力します。

定義:
インタフェース Printer 内の println
パラメータ:
message - メッセージ

close

public void close()
出力先を閉じます。

定義:
インタフェース Printer 内の close