com.infoteria.asteria.flowlibrary2.stream
Interface Record


public interface Record

ストリームをレコードとして扱うためのインターフェースです。
StreamDataObject#getRecord()メソッドにより取得され、その時点でのカレントレコードは先頭レコードになります。
Record内には複数行のレコードがラップされ、next()メソッドなどによりイテレートすることができます。


Method Summary
abstract  boolean absolute(int row)
          指定の行のレコードに移動します。
abstract  boolean first()
          先頭レコードに移動します。
abstract  Field getField(int idx)
          idxに対応するFieldを取得します。
abstract  Field getField(String name)
          nameに対応するFieldを取得します。
abstract  int getFieldCount()
          このRecordのフィールド数を返します。
abstract  int getRowIndex()
          カレントレコードの行番号を返します。
abstract  Value getValue(int idx)
          idxに対応する値を取得します。
abstract  Value getValue(String name)
          nameに対応する値を取得します。
abstract  Iterator keys()
          フィールド名のIteratorを返します。
abstract  boolean next()
          次のレコードに移動します。
カレントレコードが最終レコードの場合はfalseを返します。
abstract  Record nextRecord()
          次のレコードを返します。
実装は、

next() ? this : null;

となっており返されるオブジェクトはこのメソッドの主体と同じインスタンスです。
 

Method Detail

getField

public Field getField(String name)
nameに対応するFieldを取得します。
Parameters:
name - フィールド名
Returns:
Field。対応するフィールドがない場合はnull。

getField

public Field getField(int idx)
idxに対応するFieldを取得します。
Parameters:
idx - 0ベースのインデックス
Returns:
Field。対応するフィールドがない場合はnull。

getFieldCount

public int getFieldCount()
このRecordのフィールド数を返します。

keys

public Iterator keys()
フィールド名のIteratorを返します。

getValue

public Value getValue(String name)
               throws StreamException
nameに対応する値を取得します。
Parameters:
name - フィールド名
Returns:
Value。対応するフィールドがない場合はnull。

getValue

public Value getValue(int idx)
               throws StreamException
idxに対応する値を取得します。
Parameters:
idx - 0ベースのインデックス
Returns:
Value。対応するフィールドがない場合はnull。

first

public boolean first()
              throws StreamException
先頭レコードに移動します。
Returns:
移動に成功した場合はtrue

next

public boolean next()
             throws StreamException
次のレコードに移動します。
カレントレコードが最終レコードの場合はfalseを返します。
Returns:
移動に成功した場合はtrue

absolute

public boolean absolute(int row)
                 throws StreamException
指定の行のレコードに移動します。
Returns:
移動に成功した場合はtrue

nextRecord

public Record nextRecord()
                  throws StreamException
次のレコードを返します。
実装は、

next() ? this : null;

となっており返されるオブジェクトはこのメソッドの主体と同じインスタンスです。

getRowIndex

public int getRowIndex()
                throws StreamException
カレントレコードの行番号を返します。
Returns:
0ベースの行番号