jp.co.fujitsu.reffi.client.android.parser
クラス ComponentValues

java.lang.Object
  上位を拡張 jp.co.fujitsu.reffi.client.android.parser.ComponentValues

public class ComponentValues
extends java.lang.Object

[概 要]

コンポーネントの値を保持するComponentValueオブジェクトを集約するクラスです。

[詳 細]

JTextFieldやJComboBoxは単一の値を保持しますが、マルチセレクタブルな JListコンポーネントや、マトリクスデータを扱うtableコンポーネントは、複数の 値を保持します。
その場合、一つの値(「name属性=値」)を持つComponentValueオブジェクトを このComponentValuesが集約する形で保持します。

[備 考]

ComponentValueはnameフィールドを持ち、大抵の場合、コンポーネントが複数の値を 持つ場合でもnameフィールドの値は変わりません。

但し、tableコンポーネントの場合はnameフィールドが変わります。

        <table height="200px" id="table" name="dataTable" quickEdit="true"
                width="300px" x="40px" y="330px">

                <column>
                        <header text="姓名"/>
                </column>
                <column>
                        <header text="年齢"/>
                </column>
                <row>
                        <cell name="name" editable="true" text="山田太郎"/>
                        <cell name="age" editable="true" text="32"/>
                </row>
                <row>
                        <cell name="name" editable="true" text="鈴木一郎"/>
                        <cell name="age" editable="true" text="25"/>
                </row>
        </table>
 
上記のテーブル定義の場合、
 Parser parser = new ComponentValueParser();
 ComponentValues values = parser.parse(table);
 
戻り値valuesは以下のような構造になり、4つの名前と値を持ちます。
        ComponentValues[
                ComponentValue[
                        name = "dataTable[0].name"
                        value = "山田太郎"
                ]
                ComponentValue[
                        name = "dataTable[0].age"
                        value = "32"
                ]
                ComponentValue[
                        name = "dataTable[1].name"
                        value = "鈴木一郎"
                ]
                ComponentValue[
                        name = "dataTable[1].age"
                        value = "25"
                ]
        }
 

[環 境] JDK 6.0 Update 11

Copyright (c) 2008-2009 FUJITSU Japan All rights reserved.

作成者:
Project Reffi

コンストラクタの概要
ComponentValues()
          [概 要] デフォルトコンストラクタです。
 
メソッドの概要
 void addComponentValue(ComponentValue elementValue)
          [概 要] 単一の値を持つComponentValueオブジェクトを追加します。
 java.lang.Object getComponentValue()
          [概 要] getComponentValue(int)の0番目のインデックスの値を返却します。
 ComponentValue getComponentValue(int index)
          [概 要] 単一の値を持つComponentValueオブジェクトを返却します。
 int size()
          [概 要] このオブジェクトが何個のComponentValueオブジェクトを保有しているか返却します。
 
クラス java.lang.Object から継承されたメソッド
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

コンストラクタの詳細

ComponentValues

public ComponentValues()

[概 要]

デフォルトコンストラクタです。

[詳 細]

ComponentValueオブジェクトを集約するベクタ領域を生成します。

[備 考]

メソッドの詳細

size

public int size()

[概 要]

このオブジェクトが何個のComponentValueオブジェクトを保有しているか返却します。

[詳 細]

elementValuesフィールドのサイズを取得して返却します。

[備 考]

戻り値:
このオブジェクトが保持するComponentValueオブジェクトの数

addComponentValue

public void addComponentValue(ComponentValue elementValue)

[概 要]

単一の値を持つComponentValueオブジェクトを追加します。

[詳 細]

elementValuesフィールドに引数elementValueを追加します。

[備 考]

パラメータ:
elementValue - ComponentValueオブジェクト

getComponentValue

public ComponentValue getComponentValue(int index)

[概 要]

単一の値を持つComponentValueオブジェクトを返却します。

[詳 細]

elementValuesフィールドの引数index番目を取得して返却します。

[備 考]

パラメータ:
index - 保持インデックス
戻り値:
ComponentValueオブジェクト

getComponentValue

public java.lang.Object getComponentValue()

[概 要]

getComponentValue(int)の0番目のインデックスの値を返却します。

[詳 細]

getComponentValue(0).getValue()と同義です。

[備 考]

戻り値:
コンポーネント値


Copyright © 2008-2011. All Rights Reserved.