001    /*
002     * Copyright (c) 2009 The openGion Project.
003     *
004     * Licensed under the Apache License, Version 2.0 (the "License");
005     * you may not use this file except in compliance with the License.
006     * You may obtain a copy of the License at
007     *
008     *     http://www.apache.org/licenses/LICENSE-2.0
009     *
010     * Unless required by applicable law or agreed to in writing, software
011     * distributed under the License is distributed on an "AS IS" BASIS,
012     * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND,
013     * either express or implied. See the License for the specific language
014     * governing permissions and limitations under the License.
015     */
016    package org.opengion.fukurou.model;
017    
018    /**
019     * [PN],[OYA] などの [] でæŒ?®šされたカラãƒ?�§表されたフォーマットデータに対してã€?
020     * DBTableModelオブジェクトを適用して å�?‚«ラãƒ?�«実データを割り当てるオブジェクトですã?
021     *
022     * @og.group 画面表示
023     *
024     * @version  4.0
025     * @author   Kazuhiko Hasegawa
026     * @since    JDK5.0,
027     */
028    public interface DataModel<T> {
029    
030            /**
031             * row にあるセルのオブジェクトå?を置き換えますã?
032             *
033             * @param   vals  新しい配å?値ã€?
034             * @param   row   値が変更されるè¡?無視されまã�?
035             */
036            void setValues( final T[] vals,final int row ) ;
037    
038            /**
039             * カラãƒ?��に対応すã‚?カラãƒ?•ª号を返しますã?
040             *
041             * 特殊なカラãƒ?�ŒæŒ?®šされた場合ã?、è²??値を返しますã?
042             * 例えば、[KEY.カラãƒ?��]、[I]、[ROW.ID] など、特定ã?è²??値を返しますã?
043             * またã?カラãƒ?��がå?のãƒ??タモãƒ?ƒ«に存在しなã�??合も、è²??値かã?
044             * Exception を返しますã?è²??値なのかã?Exception なのかã?ã€?
045             * 実è£?�«依存しますã?
046             *
047             * @param   columnName  値が参照されるカラãƒ?•ª号
048             *
049             * @return  æŒ?®šされたセルのカラãƒ?•ª号
050             */
051            int getColumnNo( final String columnName ) ;
052    
053            /**
054             * カラãƒ?��配å?を返しますã?
055             * 配å?オブジェクトã?、clone されたコピã?を返しますã?
056             *
057             * @return      カラãƒ?��配å?
058             */
059            String[] getNames();
060    
061            /**
062             * row にあるセルの属æ?値をé?列で返しますã?
063             *
064             * @param   row     値が参照されるè¡?
065             *
066             * @return  æŒ?®šされたセルの属æ?値
067             */
068            T[] getValues( int row ) ;
069    
070            /**
071             * row および clm にあるセルの属æ?値を返しますã?
072             *
073             * @param   row     値が参照されるè¡?
074             * @param   clm     値が参照されるå?
075             *
076             * @return  æŒ?®šされたセルの値 T
077             */
078            T getValue(int row, int clm) ;
079    
080            /**
081             * clm のNativeタイプを返しますã?
082             * Nativeタイプã?org.opengion.fukurou.model.NativeTypeで定義されてã�?�¾すã?
083             *
084             * @og.rev 4.1.1.2 (2008/02/28) 新規追åŠ?
085             *
086             * @param  clm      値が参照されるå?
087             *
088             * @return Nativeタイãƒ?
089             * @see org.opengion.fukurou.model.NativeType
090             */
091            NativeType getNativeType( int clm );
092    }