ohymosj
クラス OhOutputFileInt

java.lang.Object
  拡張ohymosj.OhObject
      拡張ohymosj.OhPort
          拡張ohymosj.OhReceivePort
              拡張ohymosj.OhOutputPort
                  拡張ohymosj.OhOutputFile
                      拡張ohymosj.OhOutputFileInt

public class OhOutputFileInt
extends OhOutputFile

データ値が int 型であるデータパックをファイルに記録する出力端子を表すクラスです。

OhOutputFileInt; OhOutputFileInt is a class of output ports which receive datapacks of type int and print them in a file.

OhOutputFileInt receives datapacks of type int. OhOutputFileInt can be connected with OhSendInt, OhRelayInt, and OhInputFileInt.

バージョン:
$Revision: 1.2 $ $Date: 2004/02/12 05:29:42 $
作成者:
satoh

フィールドの概要
 
クラス ohymosj.OhOutputFile から継承したフィールド
_commentString, _lastDataTime, _lineLength
 
クラス ohymosj.OhReceivePort から継承したフィールド
_sender
 
クラス ohymosj.OhObject から継承したフィールド
_className, _objectName, _objectNumber, _owner, NEWLINE
 
コンストラクタの概要
OhOutputFileInt()
           デフォルトコンストラクタです。
OhOutputFileInt(java.lang.String aFileName)
           基底クラスのコンストラクタ OhOutputFile.OhOutputFile(String, int) を用いてメンバ変数を以下の通り初期化します。
OhOutputFileInt(java.lang.String aFileName, int aLineLength)
           基底クラスのコンストラクタ OhOutputFile.OhOutputFile(String, int) を用いてメンバ変数を以下の通り初期化します。
 
メソッドの概要
 java.lang.String dataType()
           出力データパックのデータ値の型 int を文字列 "int" として返します。
 boolean init(java.lang.String aFileName)
           オブジェクト名(ファイル名)を初期化し、 出力データ文字列の最大長さ(_lineLength)を 128 に、オブジェクト番号を 0 に設定します。
 boolean init(java.lang.String aFileName, int aLineLength)
           オブジェクト名(ファイル名)、出力データ文字列の最大長さ(_lineLength)を初期化し、 オブジェクト番号を 0 に設定します。
 void makeStringData(java.lang.String aStr, java.lang.Object aDataPack)
           何もしないように定義されています。
 void outputData()
           出力データを書き込みます。
 
クラス ohymosj.OhOutputFile から継承したメソッド
cPrint, getLastDataTime, getLineLength, getNecessaryTimeFrom, getNecessaryTimeTo, oPrint, setCommentString, writeHeader
 
クラス ohymosj.OhReceivePort から継承したメソッド
areYouReady, calReq, canYouGetData, canYouGetData, canYouSwitch, getDataPack, getDataPack, getDataPackArray, getNewestDataTime, getNumberOfDataPacks, getOldestDataTime, printConnection, reduceDataPackStock, setDataPackArray, setSender
 
クラス ohymosj.OhPort から継承したメソッド
create, getDataPack, getDataPack, registerReceiver
 
クラス ohymosj.OhObject から継承したメソッド
getAbsName, getClassName, getObjectName, getObjectNumber, getOwner, getTopOwner, objCompare, objCompare, objCompare, setOwner
 
クラス java.lang.Object から継承したメソッド
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

コンストラクタの詳細

OhOutputFileInt

public OhOutputFileInt()
デフォルトコンストラクタです。

デフォルトコンストラクタは 基底クラス OhOutputFile のデフォルトコンストラクタしか実行しません。 その結果、以下の設定となります。

  • _objectName : null
  • _objectNumber : -1
  • _lineLength : -1
  • その他のメンバ変数に対する処理は引数つきコンストラクタと同じです。 この場合、 OhOutputFileInt.init(String, int) を用いてメンバ変数を初期化して下さい。


    OhOutputFileInt

    public OhOutputFileInt(java.lang.String aFileName,
                           int aLineLength)
                    throws OhError
    基底クラスのコンストラクタ OhOutputFile.OhOutputFile(String, int) を用いてメンバ変数を以下の通り初期化します。

  • _className : "OhOutputFileInt"
  • _objectName : aFileName
  • _objectNumber : 0
  • _lineLength : aLineLength
  • _lastDataTime : OhTimePoint.OhTimePointMin
  • _commentString : null
  • パラメータ:
    aFileName - a String value
    aLineLength - an int value

    OhOutputFileInt

    public OhOutputFileInt(java.lang.String aFileName)
                    throws OhError
    基底クラスのコンストラクタ OhOutputFile.OhOutputFile(String, int) を用いてメンバ変数を以下の通り初期化します。

  • _className : "OhOutputFileInt"
  • _objectName : aFileName
  • _objectNumber : 0
  • _lineLength : 128
  • _lastDataTime : OhTimePoint.OhTimePointMin
  • _commentString : null
  • パラメータ:
    aFileName - a String value
    メソッドの詳細

    init

    public boolean init(java.lang.String aFileName,
                        int aLineLength)
                 throws OhError
    オブジェクト名(ファイル名)、出力データ文字列の最大長さ(_lineLength)を初期化し、 オブジェクト番号を 0 に設定します。

    _lineLength が 0 より大きい場合、二重設定と判断して false を返します。 _lineLength が 0 以下ならば、_lineLength を aLineLength に設定して true を返します。

    Initialization.

    オーバーライド:
    クラス OhOutputFile 内の init
    パラメータ:
    aFileName - a String value
    aLineLength - an int value
    戻り値:
    a boolean value
    例外:
    OhError

    init

    public boolean init(java.lang.String aFileName)
                 throws OhError
    オブジェクト名(ファイル名)を初期化し、 出力データ文字列の最大長さ(_lineLength)を 128 に、オブジェクト番号を 0 に設定します。

    _lineLength が 0 より大きい場合、二重設定と判断して false を返します。

    Initialization.

    オーバーライド:
    クラス OhOutputFile 内の init
    パラメータ:
    aFileName - a String value
    戻り値:
    a boolean value
    例外:
    OhError - if an error occurs

    dataType

    public java.lang.String dataType()
    出力データパックのデータ値の型 int を文字列 "int" として返します。

    Returns the datapack type, "int", which expresses the type of data to be received.

    定義:
    クラス OhOutputFile 内の dataType
    戻り値:
    a String value

    makeStringData

    public void makeStringData(java.lang.String aStr,
                               java.lang.Object aDataPack)
    何もしないように定義されています。

    Nothing is treated.

    定義:
    クラス OhOutputFile 内の makeStringData
    パラメータ:
    aStr - a String value
    aDataPack - an Object value

    outputData

    public void outputData()
                    throws java.io.IOException
    出力データを書き込みます。

    まず、出力ファイル _objectName を追加書きモードでオープンし、 オープンできない場合は return します。

    次に、受信データパック配列 _dataPackArray の先頭に格納されているデータパックから順番に OhDataPackInt.dpack2Ofile(PrintWriter) を用いて出力ファイルに記入します。

    ※注意

    受信データパックはこのメソッドの中で取得されます。 モデル OhOutputFile は受信端子の派生モデルであって、 データパックをストックする機能はありません。

    Though this method is defined in the base class OhOutputFile, it is redifined in OhOutputFileInt.

    オーバーライド:
    クラス OhOutputFile 内の outputData
    例外:
    java.io.IOException - if an error occurs