com.hamaf.hikyaku.report.excel2003
クラス ExcelSheet

java.lang.Object
  上位を拡張 com.hamaf.hikyaku.report.excel2003.ExcelSheet

public class ExcelSheet
extends java.lang.Object

タイトル: ExcelSheet is Excel sheet object.

説明:Excelのシートに対応したオブジェクト。


以下の機能を提供する
  1. init(ExcelDoc, String) : 初期処理(新規作成用)
  2. init(ExcelDoc, Element) : 既存エレメントを保持する
  3. setWidth : 各セル幅を設定する
  4. getValue : セルの値を取得する
  5. setValue : 指定範囲の各セルの値を設定する
  6. setRowValue : 1行分のセルの値を設定する
  7. setCellValue : 1セルの値を設定する
  8. copyAddValue : 1行複写し、値を設定する
  9. getRow : 行オブジェクトを取得する
  10. getRowCount : 行数を取得する
  11. deleteRow : 行を削除する
  12. setStyle : 指定範囲の各セルにスタイルを設定する
  13. getSheet : シート・エレメントを戻す

Created: Tue Nov 25 14:35:53 2008

バージョン:
1.0
作成者:
y-hamanaka -

コンストラクタの概要
ExcelSheet()
          Creates a new ExcelSheet instance.
 
メソッドの概要
 void copyAddValue(java.util.List<java.util.List<java.lang.Object>> val, int org, int col)
          Describe copyAddValue method : row copy and value set.
 org.w3c.dom.Node deleteRow(int row)
          Describe deleteRow method : delete row.
 ExcelRow getRow(int row)
          Describe getRow method : get Row Object.
 int getRowCount()
          Describe getRowCount method : get row count.
 org.w3c.dom.Element getSheet()
          Gets the value of sht
 java.lang.String getValue(int row, int col)
          Describe getValue method : get cell value.
 void init(ExcelDoc book, org.w3c.dom.Element wsht)
          Describe init method : save worksheet Element.
 void init(ExcelDoc book, java.lang.String name)
          Describe init method : create WorkSheet Element.
 int[] searchCell(java.lang.String val)
          Describe searchCell method : search cell position by value.
 void setCellValue(java.lang.Object val, int row, int col, java.lang.String high)
          Describe setCellValue method : 1セルの値を設定する.
 void setRowValue(java.util.List<java.lang.Object> val, int row, int col, java.lang.String high)
          Describe setRowValue method : 1行分の値を設定する.
 void setStyle(ExcelStyle sty, int strRow, int endRow, int strCol, int endCol)
          Describe setStyle method : 指定された範囲にスタイル属性を設定する.
 void setStyle(java.lang.String styId, int strRow, int endRow, int strCol, int endCol)
          Describe setStyle method : 指定された範囲にスタイル属性を設定する.
 void setValue(java.util.List<java.util.List<java.lang.Object>> val, int row, int col, java.lang.String high)
          Describe setValue method : set valus.
 void setWidth(java.util.List<java.lang.String> width)
          Describe setWidth method : setting columns width.
 
クラス java.lang.Object から継承されたメソッド
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

コンストラクタの詳細

ExcelSheet

public ExcelSheet()
Creates a new ExcelSheet instance.

メソッドの詳細

init

public void init(ExcelDoc book,
                 java.lang.String name)
          throws java.lang.Exception
Describe init method : create WorkSheet Element.
WorkSheetに対応するエレメントを生成する。

パラメータ:
book - an ExcelDoc :
name - a String : シート名
例外:
java.lang.Exception - if an error occurs

init

public void init(ExcelDoc book,
                 org.w3c.dom.Element wsht)
          throws java.lang.Exception
Describe init method : save worksheet Element.
既存のワークシート・エレメントを保持する

パラメータ:
book - an ExcelDoc :
wsht - an Element :
例外:
java.lang.Exception

setWidth

public void setWidth(java.util.List<java.lang.String> width)
              throws java.lang.Exception
Describe setWidth method : setting columns width.
各カラムの幅を設定する。
Excelの"幅の指定"で設定する値を各カラム毎に指定する。
変更しないカラムに対しては空の文字列("")を指定すること。

パラメータ:
width - a List<String> : 各カラムの幅を指定したリスト
例外:
java.lang.Exception - if an error occurs

getValue

public java.lang.String getValue(int row,
                                 int col)
Describe getValue method : get cell value.
指定された、行、列の値を取得する

パラメータ:
row - an int : 行位置
col - an int : 列位置
戻り値:
a String : 取得した値

setValue

public void setValue(java.util.List<java.util.List<java.lang.Object>> val,
                     int row,
                     int col,
                     java.lang.String high)
              throws java.lang.Exception
Describe setValue method : set valus.
ワークシートに値を設定する。
値は行のリスト内に各列毎の値リストを設定する。
指定行(row)の値が "0" の場合は、追加となる。

パラメータ:
val - a List<List<Object>> : 設定する値リスト
row - an int : 開始行
col - an int : 開始列
high - a String : 行の高さ
例外:
java.lang.Exception - if an error occurs

setRowValue

public void setRowValue(java.util.List<java.lang.Object> val,
                        int row,
                        int col,
                        java.lang.String high)
                 throws java.lang.Exception
Describe setRowValue method : 1行分の値を設定する.

パラメータ:
val - a List<Object> : 設定する値リスト
row - an int : 設定行位置
col - an int : 開始列
high - a String : 行の高さ
例外:
java.lang.Exception - if an error occurs

setCellValue

public void setCellValue(java.lang.Object val,
                         int row,
                         int col,
                         java.lang.String high)
                  throws java.lang.Exception
Describe setCellValue method : 1セルの値を設定する.

パラメータ:
val - an Object : 設定する値
row - an int : 設定行位置
col - an int : 設定列位置
high - a String : 行の高さ
例外:
java.lang.Exception - if an error occurs

copyAddValue

public void copyAddValue(java.util.List<java.util.List<java.lang.Object>> val,
                         int org,
                         int col)
                  throws java.lang.Exception
Describe copyAddValue method : row copy and value set.
指定された行を下方に複写し、値を設定する。

パラメータ:
val - a List<List<Object>> : 設定する値リスト
org - an int : 元にする行位置
col - an int : 設定列位置
例外:
java.lang.Exception - if an error occurs

getRow

public ExcelRow getRow(int row)
                throws java.lang.Exception
Describe getRow method : get Row Object.
Excel行オブジェクトを取得する

パラメータ:
row - an int : 行位置
戻り値:
an ExcelRow : 取得したExcel Row オブジェクト
例外:
java.lang.Exception - if an error occurs

getRowCount

public int getRowCount()
Describe getRowCount method : get row count.
ワークシートに設定されている行数を取得する

戻り値:
an int : 行数

deleteRow

public org.w3c.dom.Node deleteRow(int row)
                           throws java.lang.Exception
Describe deleteRow method : delete row.
指定された行を削除し、削除したNodeを戻す

パラメータ:
row - an int : 削除する行位置
戻り値:
a Node : 削除したNode
例外:
java.lang.Exception - if an error occurs

searchCell

public int[] searchCell(java.lang.String val)
                 throws java.lang.Exception
Describe searchCell method : search cell position by value.
指定された値を持つセルの 行、列 を取得する。

パラメータ:
val - a String : 検索する値
戻り値:
a int[] : [行, 列]の値
例外:
java.lang.Exception

setStyle

public void setStyle(java.lang.String styId,
                     int strRow,
                     int endRow,
                     int strCol,
                     int endCol)
              throws java.lang.Exception
Describe setStyle method : 指定された範囲にスタイル属性を設定する.

パラメータ:
styId - a String : スタイル属性値
strRow - an int : 行の開始位置
endRow - an int : 行の終了位置
strCol - an int : 列の開始位置
endCol - an int : 列の終了位置
例外:
java.lang.Exception - if an error occurs

setStyle

public void setStyle(ExcelStyle sty,
                     int strRow,
                     int endRow,
                     int strCol,
                     int endCol)
              throws java.lang.Exception
Describe setStyle method : 指定された範囲にスタイル属性を設定する.

パラメータ:
sty - an ExcelStyle :
strRow - an int : 行の開始位置
endRow - an int : 行の終了位置
strCol - an int : 列の開始位置
endCol - an int : 列の終了位置
例外:
java.lang.Exception - if an error occurs

getSheet

public final org.w3c.dom.Element getSheet()
Gets the value of sht

戻り値:
the value of sht