com.hamaf.hikyaku.dataobject
クラス KeyList

java.lang.Object
  上位を拡張 com.hamaf.hikyaku.dataobject.KeyList
すべての実装されたインタフェース:
java.lang.Iterable<java.util.List<java.lang.String>>

public class KeyList
extends java.lang.Object
implements java.lang.Iterable<java.util.List<java.lang.String>>

タイトル:KeyList is Keep Key List Information.

説明:一覧表示処理用のKey配列を管理するクラス


保管する項目は
  1. Retrieve : 検索項目を保持するMap <String, String>
  2. KeyData : 一覧対象データのKeyオブジェクトを保持するList <List<String>>
  3. Spare : 一覧対象データのkeyに対応した、補助エリア
  4. PageCount : 1頁あたりのライン数
  5. LastAccess : 最後に戻したKeyオブジェクトの位置
  6. Process : プロセスID
  7. SysId : システムID
  8. CharCD : 文字コード

状況取得メソッドとして以下のメソッドを用意しています
iterator()でKeyDataのIteratorを戻します。

メモリー削減としてKeyDataを一時ファイルに退避する機能があります。

著作権: Copyright (c) 2003/12/26

バージョン:
1.0
作成者:
Hamanaka

入れ子のクラスの概要
static class KeyList.PAGE_ACT
           
 
コンストラクタの概要
KeyList(java.util.Map<java.lang.String,java.lang.String> key)
          Creates a new KeyList.java instance.
 
メソッドの概要
 void addKey(java.util.List<java.lang.String> key)
          Describe addKey method : add key item.
 java.lang.String getCharCD()
           
 int getCurrentPage()
          Describe getCurrentPage method : get current page.
 int getDataCount()
          Describe getDataCount method : return total count.
 java.util.List<java.lang.String> getKey(int idx)
          Describe getKey method : get Item at position.
 java.util.List<java.lang.String> getKeyFields()
           
 int getLastPos()
          Describe getLastPos method : return end position.
 int getMaxPageNo()
          Describe getMaxPageNo method : get Max Page No.
 java.util.List<java.lang.String> getNextKey()
          Describe getNextKeyt method : net item at last access.
 int getPageCount()
          Describe getPageCount method : return line count per page.
 java.lang.String getProcess()
           
 java.lang.String getRetrieve(java.lang.String key)
          Describe getRetrieve method : get retrieve item at key.
 java.lang.String getRetrieve4Jsp(java.lang.String key)
          Describe getRetrieve2Jsp method : get JSP format retrieve item at key.
 java.util.Map<java.lang.String,java.lang.String> getRetrieveAll()
          Describe getRetrieveAll method : return retrieve Map.
 java.lang.Object getSpare(int pos)
          Describe getSpare method : get value from spareMap.
 java.util.Map<java.lang.Integer,java.lang.Object> getSpareMap()
          Describe getSpareMap method : return spareMap.
 java.util.List<java.lang.String> getStartKey(KeyList.PAGE_ACT direction)
          Describe getStartKey method : get start position item.
 int getStartPos()
          Describe getStartPos method : return start position.
 java.lang.String getSysId()
          Get the SysId value.
 boolean hasBackPage()
          Describe hasBack method : check back page ok.
 boolean hasNext()
          Describe hasNext method : check next position.
 boolean hasNextPage()
          Describe hasNextPage method : check next page ok.
 void init()
          Describe init method : save area initialize.
 java.util.ListIterator<java.util.List<java.lang.String>> iterator()
          Keyデータ一覧のIteratorを戻す.
 void releaseKeyData()
          Describe releaseKeyData method : KeyData release.
 void resetKeyData()
          Describe resetKeyData method : set KeyData from temp file.
 void saveKeyData()
          Describe saveKeyData method : write Key Data to temp file.
 void setCharCD(java.lang.String charCD)
           
 void setCurrentPage(java.lang.String page)
          Describe setCurrentPage method : reset current page.
 void setKeyDataAll(java.util.List<java.util.List<java.lang.String>> argList)
          Describe setKeyDataAll method : set all items changed key List.
 void setKeyFields(java.util.List<java.lang.String> keyFields)
           
 void setPageCount(int argI)
          Describe setPageCount method : set line count par page.
 void setPageCount(java.lang.String argS)
          Describe setPageCount method : set line count par page.
 void setProcess(java.lang.String process)
           
 void setSpare(int pos, java.lang.Object val)
          Describe setSpare method : setting value in spareMap.
 void setSysId(java.lang.String newSysId)
          Set the SysId value.
 java.lang.String toKeysString()
          Describe toKeysString method : キー一覧の保持内容を戻す.
 java.lang.String toStatusString()
          Describe toStatusString method : 状況保持項目の文字列値を戻す.
 
クラス java.lang.Object から継承されたメソッド
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

コンストラクタの詳細

KeyList

public KeyList(java.util.Map<java.lang.String,java.lang.String> key)
Creates a new KeyList.java instance.
Default Constructor

パラメータ:
key -
メソッドの詳細

init

public final void init()
Describe init method : save area initialize. Key項目保存用領域をクリアーする。


getStartKey

public final java.util.List<java.lang.String> getStartKey(KeyList.PAGE_ACT direction)
                                                   throws java.lang.IndexOutOfBoundsException
Describe getStartKey method : get start position item.
引数の方向に対応した以下の項目を戻す。
  1. FORWARD - 最後に取得したデータの次のデータ
  2. BACK - 1ページ前の最初のデータ
  3. SAME - 同一ページの最初のデータ

パラメータ:
direction - an int : 取り出すデータの方向
戻り値:
an List<String> : 該当する項目
例外:
java.lang.IllegalArgumentException - : 引数がFORWARD,BACK,SAME 以外の場合に投げる例外
java.lang.IndexOutOfBoundsException - : 取得する位置が配列を超えた場合に投げる例外

getNextKey

public final java.util.List<java.lang.String> getNextKey()
                                                  throws java.lang.IndexOutOfBoundsException
Describe getNextKeyt method : net item at last access.
最後に取得したデータの次のデータを戻します。

戻り値:
a List<String> : 該当する項目
例外:
java.lang.IndexOutOfBoundsException - : 取得する位置が配列を超えた場合に投げる例外

hasNext

public final boolean hasNext()
Describe hasNext method : check next position.
次に取得するデータがある場合にtrueを戻します。
次の位置が項目数以下で1ページの行数以下のときに取得項目があると判断します。

戻り値:
a boolean : 取得データがある場合 "真"

hasBackPage

public final boolean hasBackPage()
Describe hasBack method : check back page ok.
前の頁で取得するデータがある場合にtrueを戻します。
トップのデータの位置が1以上のときに可能と判断します。

戻り値:
a boolean : 取得データがある場合 "真"

hasNextPage

public final boolean hasNextPage()
Describe hasNextPage method : check next page ok.
次の頁で取得するデータがある場合にtrueを戻します。
最後のデータの位置がキー件数以下のときに可能と判断します。

戻り値:
a boolean : 取得データがある場合 "真"

getKey

public final java.util.List<java.lang.String> getKey(int idx)
                                              throws java.lang.IndexOutOfBoundsException
Describe getKey method : get Item at position.
指定された位置のデータを戻します。

パラメータ:
idx - a Object : データを取得する位置
戻り値:
a List<String> : 指定された位置のデータ
例外:
java.lang.IndexOutOfBoundsException - : 取得する位置が配列を超えた場合に投げる例外

getPageCount

public final int getPageCount()
Describe getPageCount method : return line count per page.
一ページの行数を戻します。

戻り値:
an int : 1ページの行数

getDataCount

public final int getDataCount()
Describe getDataCount method : return total count.
keyデータの件数を戻す。

戻り値:
a int : データ件数

getStartPos

public final int getStartPos()
Describe getStartPos method : return start position.
キーデータを取得した開始位置を戻す。

戻り値:
a int : 開始位置

getLastPos

public final int getLastPos()
Describe getLastPos method : return end position.
キーデータを取得した終了位置を戻す。

戻り値:
a int : 終了位置

getRetrieve

public final java.lang.String getRetrieve(java.lang.String key)
Describe getRetrieve method : get retrieve item at key.
検索項目のMapから指定されたkey値の項目を戻す。
値が存在しない(== null)とき、長さ0の文字列("")を戻す。

パラメータ:
key - a String : 取得する項目の名称
戻り値:
a String : 取得した値

getRetrieve4Jsp

public java.lang.String getRetrieve4Jsp(java.lang.String key)
Describe getRetrieve2Jsp method : get JSP format retrieve item at key.
検索項目のMapから指定されたkey値の項目をJSPの表示用の形式で戻す。
JSPでの表示用にコード変換、タグ文字変換を行います。
値が存在しない(== null)とき、長さ0の文字列("")を戻す。

パラメータ:
key - a String : 取得する項目の名称
戻り値:
a String : 変換した値

getRetrieveAll

public final java.util.Map<java.lang.String,java.lang.String> getRetrieveAll()
Describe getRetrieveAll method : return retrieve Map.
検索項目を保存したMapを戻します。

戻り値:
a Map : 検索項目を保存しているMap

addKey

public final void addKey(java.util.List<java.lang.String> key)
Describe addKey method : add key item.
key配列にデータを登録する。

パラメータ:
key - a Object : 登録するデータ

iterator

public final java.util.ListIterator<java.util.List<java.lang.String>> iterator()
Keyデータ一覧のIteratorを戻す.

定義:
インタフェース java.lang.Iterable<java.util.List<java.lang.String>> 内の iterator
関連項目:
Iterable.iterator()

setKeyDataAll

public final void setKeyDataAll(java.util.List<java.util.List<java.lang.String>> argList)
Describe setKeyDataAll method : set all items changed key List.
key配列を引き渡されたList Objectの値で置き換えます。

パラメータ:
argList - a List : 設定するkey値の配列

setPageCount

public final void setPageCount(int argI)
Describe setPageCount method : set line count par page.
1ページ当りの行数を設定します。

パラメータ:
argI - an int : 1ページ当りの行数

setPageCount

public final void setPageCount(java.lang.String argS)
Describe setPageCount method : set line count par page.
1ページ当りの行数を設定します。

パラメータ:
argS - a String : 1ページ当りの行数

setSpare

public final void setSpare(int pos,
                           java.lang.Object val)
Describe setSpare method : setting value in spareMap.
位置指定で予備領域に値を設定する。

パラメータ:
pos - an int : 対象となるデータの位置
val - an Object : 保存する値

getSpare

public final java.lang.Object getSpare(int pos)
Describe getSpare method : get value from spareMap.
予備領域から指定された位置の値を取得する。

パラメータ:
pos - an int : 取得する値の位置
戻り値:
an Object : 取得した値

getSpareMap

public final java.util.Map<java.lang.Integer,java.lang.Object> getSpareMap()
Describe getSpareMap method : return spareMap.
予備領域(Map)を戻す。

戻り値:
a Map : 予備領域

setCurrentPage

public final void setCurrentPage(java.lang.String page)
Describe setCurrentPage method : reset current page.
現在の頁位置を指定された値に変更する。

パラメータ:
page - a void : 変更する頁位置

getCurrentPage

public final int getCurrentPage()
Describe getCurrentPage method : get current page.
現在の頁位置を取得する。

戻り値:
a int : 現在の頁位置

getMaxPageNo

public final int getMaxPageNo()
Describe getMaxPageNo method : get Max Page No.
最大ページ数を戻す。

戻り値:
a int : 最大ページ数

getSysId

public final java.lang.String getSysId()
Get the SysId value.

戻り値:
a String :

setSysId

public final void setSysId(java.lang.String newSysId)
Set the SysId value.

パラメータ:
newSysId - The new SysId value.

getCharCD

public final java.lang.String getCharCD()
戻り値:
charCD

setCharCD

public final void setCharCD(java.lang.String charCD)
パラメータ:
charCD - charCD を設定します。

getProcess

public final java.lang.String getProcess()
戻り値:
process

setProcess

public final void setProcess(java.lang.String process)
パラメータ:
process - process を設定します。

getKeyFields

public final java.util.List<java.lang.String> getKeyFields()
戻り値:
keyFields

setKeyFields

public final void setKeyFields(java.util.List<java.lang.String> keyFields)
パラメータ:
keyFields - keyFields を設定します。

saveKeyData

public final void saveKeyData()
Describe saveKeyData method : write Key Data to temp file.
KeyDataの内容を一時ファイルに書き出す。


releaseKeyData

public final void releaseKeyData()
Describe releaseKeyData method : KeyData release.
KeyData 領域を開放する。


resetKeyData

public final void resetKeyData()
Describe resetKeyData method : set KeyData from temp file.
一時ファイルから KeyData を復元する。


toStatusString

public java.lang.String toStatusString()
Describe toStatusString method : 状況保持項目の文字列値を戻す.
以下の項目の文字列値を生成します。

戻り値:
a String :

toKeysString

public java.lang.String toKeysString()
Describe toKeysString method : キー一覧の保持内容を戻す.
以下の項目の文字列値を生成します。

戻り値:
a String :