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.hayabusa.db;
017    
018    import java.util.HashMap;
019    import java.util.HashSet;
020    import java.util.Map;
021    import java.util.Set;
022    
023    import org.opengion.fukurou.util.StringUtil;
024    
025    /**
026     * エãƒ?‚£ãƒ?ƒˆè¨­å®šæƒ…報を管ç�?�™ã‚‹ã�Ÿã‚�ã?ãƒ??タ管ç�?‚¯ãƒ©ã‚¹ã�§ã�™ã?
027     * ã�“ã�“ã�§ç®¡ç�?�•れるå�?ƒ‘ラメーターã�®æ„�味ã�¯ä»¥ä¸‹ã?通りã�§ã�™ã?
028     * (å�?‚¤ãƒ³ãƒ?ƒƒã‚¯ã‚¹ç•ªå�·ã�¯ã€�å?部çš?�«ç®¡ç�?�•れã�¦ã�?‚‹ã‚¤ãƒ³ãƒ?ƒƒã‚¯ã‚¹ç•ªå�·ã‚’æ„�味ã�—ã�¾ã�?
029     *
030     * ・0:エãƒ?‚£ãƒ?ƒˆå�?
031     *       ã�“ã?エãƒ?‚£ãƒ?ƒˆè¨­å®šã‚ªãƒ–ジェクトã?å��ç§°ã�§ã�™ã?
032     * ・1:表示カラ�
033     *       表示対象ã�¨ã�ªã‚‹ã‚«ãƒ©ãƒ?¸?¦§ã�§ã�™ã?カンマ区åˆ?‚Šã�§æŒ?®šã�—ã�¾ã�™ã?
034     *       ã�“ã?ä¸?¦§ã�«ã�¯ã€?�žè¡¨ç¤ºã�®ã‚«ãƒ©ãƒ?‚‚å�ˆã‚�ã�›ã�¦ç®¡ç�?�•れã?é�žè¡¨ç¤ºã‚«ãƒ©ãƒ?�«ã�¤ã�?�¦ã�¯ã€?
035     *       カラãƒ?��ã�®å…ˆé?ã�«"!"ã‚’ã�¤ã�‘ã�¾ã�™ã?
036     *       ä¾? AAA,!BBB,CCC â‡?AAA,CCCã�®é ?�«è¡¨ç¤º(BBBã�¯é�žè¡¨ç¤º)
037     * ・2:é›?¨ˆã‚«ãƒ©ãƒ?
038     *       å�??ã‚’SUMã�™ã‚‹å¯¾è±¡ã�¨ã�ªã‚‹ã‚«ãƒ©ãƒ?�§ã�™ã?(カンマ区åˆ?‚Šã�§è¤?•°æŒ?®šã�Œå�¯èƒ½)
039     *       ã�“ã�“ã�§æŒ?®šã�•れã�Ÿã‚«ãƒ©ãƒ??数値型ã�§ã�‚ã‚‹å¿?¦�ã�Œã�‚りã�¾ã�™ã?
040     *       SQLæ§‹æ–‡ã�«ã�Šã�‘ã‚‹ã?SUM関数ã�®å¼•æ•°ã�¨ã�—ã�¦æŒ?®šã�™ã‚‹ã‚«ãƒ©ãƒ?�«ç›¸å½“ã�—ã�¾ã�™ã?
041     * ・3:グループカラ�
042     *       é›?¨ˆã‚«ãƒ©ãƒ??å�??をグルーピングã�™ã‚‹ã�Ÿã‚�ã�®ã‚«ãƒ©ãƒ?�§ã�™ã?(カンマ区åˆ?‚Šã�§è¤?•°æŒ?®šã�Œå�¯èƒ½)
043     *       SQLæ§‹æ–‡ã�«ã�Šã�‘ã‚‹ã?GROUP BYã�«æŒ?®šã�™ã‚‹ã‚«ãƒ©ãƒ?�«ç›¸å½“ã�—ã�¾ã�™ã?
044     * ・4:�計カラ�
045     *       é›?¨ˆã‚«ãƒ©ãƒ??å�??ã�«å¯¾ã�—ã?å°�計行を付加ã�™ã‚‹ã�Ÿã‚�ã�®ãƒ–レイクキーを指定ã�—ã�¾ã�™ã?(カンマ区åˆ?‚Šã�§è¤?•°æŒ?®šã�Œå�¯èƒ½)
046     * ・5:�計カラ�
047     *       é›?¨ˆã‚«ãƒ©ãƒ??å�??ã�«å¯¾ã�—ã?å�ˆè¨ˆè¡Œã‚’付加ã�™ã‚‹ã�Ÿã‚�ã�®ãƒ–レイクキーを指定ã�—ã�¾ã�™ã?(カンマ区åˆ?‚Šã�§è¤?•°æŒ?®šã�Œå�¯èƒ½)
048     * ・6:��計フラグ
049     *       é›?¨ˆã‚«ãƒ©ãƒ??å�??ã�«å¯¾ã�—ã?ç·�å�ˆè¨ˆè¡Œã‚’付加ã�™ã‚‹ã�‹ã�©ã�?�‹ã‚’指定ã�—ã�¾ã�™ã?(0以å¤?追åŠ?�™ã‚?0:追åŠ?�—ã�ªã�?
050     * ・7:表示é ?‚«ãƒ©ãƒ?
051     *       ãƒ??ã‚¿ã�®è¡¨ç¤ºé ?‚’ã��ã?é ?•ªã�«ã‚«ãƒ³ãƒžåŒºåˆ?‚Šã�§æŒ?®šã�—ã�¾ã�™ã?
052     *       カラãƒ?��ã�®å…ˆé?ã�«"!"ã‚’ã�¤ã�‘ã�Ÿå ´å�ˆã?ã€�ã��ã�®ã‚«ãƒ©ãƒ??é™�é?ã�§è¡¨ç¤ºã�•れã�¾ã�™ã?
053     *       SQLæ§‹æ–‡ã�«ã�Šã�‘ã‚‹ã?orderbyå�¥ã�«ç›¸å½“ã�—ã�¾ã�™ã?
054     * ・8:共通フラグ
055     *       ã�“ã?エãƒ?‚£ãƒ?ƒˆè¨­å®šã‚ªãƒ–ジェクトã�Œã€�å?é€?全ユーザー公é–?エãƒ?‚£ãƒ?ƒˆã�‹ã�©ã�?�‹ã‚?
056     *       æŒ?®šã�—ã�¾ã�™ã?(0以å¤?å…±é€?0:個人ã�®ã�¿)
057     *
058     * @og.rev 5.3.6.0 (2011/06/01) 新�追�
059     *
060     * @version  5.0
061     * @author   Hiroki Nakamura
062     * @since    JDK6.0,
063     */
064    public class DBEditConfig {
065    
066            private static final int EDIT_KEY_NAME          = 0;
067            private static final int EDIT_KEY_VIEW          = 1;
068            private static final int EDIT_KEY_SUM           = 2;
069            private static final int EDIT_KEY_GROUP         = 3;
070            private static final int EDIT_KEY_SUBTOTAL      = 4;
071            private static final int EDIT_KEY_TOTAL         = 5;
072            private static final int EDIT_KEY_GRANDTOTAL= 6;
073            private static final int EDIT_KEY_ORDERBY       = 7;
074            private static final int EDIT_KEY_COMMON        = 8;
075    
076            private static final String[] EDIT_KEYS
077                    = { "NAME", "VIEW", "SUM", "GROUP", "SUBTOTAL", "TOTAL", "GRANDTOTAL", "ORDERBY", "COMMON" };
078    
079            private static final int EDIT_KEYS_LENGTH       = EDIT_KEYS.length;
080    
081            private final String[] editVals = new String[EDIT_KEYS_LENGTH];
082    
083            private int sumClmCount;
084            private int groupClmCount;
085            private int subTotalClmCount;
086            private int totalClmCount;
087            private final Map<String,String> orderMap = new HashMap<String,String>();
088            private String orderByDescClms;
089    
090            /**
091             * コンストラクタ
092             *
093             * 空ã�®ã‚¨ãƒ?‚£ãƒ?ƒˆè¨­å®šã‚ªãƒ–ジェクトを構築ã�—ã�¾ã�™ã?
094             */
095            public DBEditConfig() {
096            }
097    
098            /**
099             * コンストラクタ
100             *
101             * å�?¨®ãƒ‘ラメーターを指定ã�—ã�¦ã‚¨ãƒ?‚£ãƒ?ƒˆè¨­å®šã‚ªãƒ–ジェクトを構築ã�—ã�¾ã�™ã?
102             *
103             * @param editName エãƒ?‚£ãƒ?ƒˆå��ç§°
104             * @param viewClms 画�表示カラ�
105             * @param sumClms é›?¨ˆã‚«ãƒ©ãƒ?
106             * @param groupClms グループカラ�
107             * @param subTotalClms �計カラ�
108             * @param totalClms �計カラ�
109             * @param useGrandTotal ç·�å�ˆè¨ˆè¡Œã‚’追åŠ?�™ã‚‹ã�‹(1:追åŠ?�™ã‚?1以å¤?追åŠ?�—ã�ªã�?
110             * @param orderByClms 表示�
111             * @param isCommon 共通エãƒ?‚£ãƒ?ƒˆã�‹ã�©ã�?�‹(1:å…±é€?1以å¤?個人ã�®ã�¿)
112             */
113            public DBEditConfig( final String editName, final String viewClms
114                                                    , final String sumClms, final String groupClms
115                                                    , final String subTotalClms, final String totalClms
116                                                    , final String useGrandTotal, final String orderByClms
117                                                    , final String isCommon ) {
118    
119                    editVals[EDIT_KEY_NAME]                 = editName;
120                    editVals[EDIT_KEY_VIEW]                 = viewClms;
121                    editVals[EDIT_KEY_SUM]                  = sumClms;
122                    editVals[EDIT_KEY_GROUP]                = groupClms;
123                    editVals[EDIT_KEY_SUBTOTAL]             = subTotalClms;
124                    editVals[EDIT_KEY_TOTAL]                = totalClms;
125                    editVals[EDIT_KEY_GRANDTOTAL]   = useGrandTotal;
126                    editVals[EDIT_KEY_ORDERBY]              = orderByClms;
127                    editVals[EDIT_KEY_COMMON]               = isCommon;
128    
129                    init();
130            }
131    
132            /**
133             * コンストラクタ
134             *
135             * å�?¨®ãƒ‘ラメーターをé?列ã�§æŒ?®šã�—ã�¦ã‚¨ãƒ?‚£ãƒ?ƒˆè¨­å®šã‚ªãƒ–ジェクトを構築ã�—ã�¾ã�™ã?
136             * å�?ƒ‘ラメータã�®é…�å?インãƒ?ƒƒã‚¯ã‚¹ã�¯ã€�{@link #getEditKeys(String,String)}ã�§è¿”ã�•れる
137             * キーä¸?¦§ã�®é…�å?インãƒ?ƒƒã‚¯ã‚¹ã�¨ä¸??ã�—ã�¾ã�™ã?
138             * å�?ƒ‘ラメーターã�®æ„�味ã�«ã�¤ã�?�¦ã�¯ã€�クラスã�®Javadoc{@link DBEditConfig}ã‚’å�‚ç…§ã�—ã�¦ä¸‹ã�•ã�??
139             *
140             * @param editVals 設定å?(é…�å?)
141             * @see DBEditConfig
142             * @see #getEditKeys(String,String)
143             **/
144            public DBEditConfig( final String[] editVals ) {
145                    System.arraycopy( editVals, 0, this.editVals, 0, editVals.length );
146                    init();
147            }
148    
149            /**
150             * エãƒ?‚£ãƒ?ƒˆè¨­å®šã‚ªãƒ–ジェクト作æ?時ã?åˆ�期化å?ç�?�§ã�™ã?
151             * コンストラクタã�®å¼•æ•°ã�«åŸºã�¥ã��å?部変数ã�®åˆ�期設定を行ã�„ã�¾ã�™ã?
152             */
153            private void init() {
154                    sumClmCount = StringUtil.csv2Array( editVals[EDIT_KEY_SUM] ).length;
155                    groupClmCount = StringUtil.csv2Array( editVals[EDIT_KEY_GROUP] ).length;
156                    subTotalClmCount = StringUtil.csv2Array( editVals[EDIT_KEY_SUBTOTAL] ).length;
157                    totalClmCount = StringUtil.csv2Array( editVals[EDIT_KEY_TOTAL] ).length;
158    
159                    if( editVals[EDIT_KEY_ORDERBY] != null ) {
160                            StringBuilder buf = new StringBuilder();
161                            String[] ary = StringUtil.csv2Array( editVals[EDIT_KEY_ORDERBY] );
162                            for( int i=0; i<ary.length ;i++ ) {
163                                    String str = ary[i];
164                                    if( str.startsWith( "!" ) ) {
165                                            str = str.substring( 1 );
166                                            if( buf.length() > 0 ) { buf.append( "," ); }
167                                            buf.append( str );
168                                    }
169                                    orderMap.put( str, String.valueOf( i+1 ) );
170                            }
171                            orderByDescClms = buf.toString();
172                    }
173                    else {
174                            orderByDescClms = null;
175                    }
176            }
177    
178            /**
179             * キーé…�å?ã�‹ã‚‰ç”»é�¢IDã�¨ã‚¨ãƒ?‚£ãƒ?ƒˆå��ç§°ã�®ãƒšã‚¢ã�®ä¸?¦§ã‚’å�–りå?ã�—ã�¾ã�™ã?
180             *
181             * キーé…�å?ã�‹ã‚‰"EDIT_NAME_"ã�§å§‹ã�¾ã‚‹ã‚­ãƒ¼ã‚’検索ã�—ã?"EDIT_NAME_(ç”»é�¢ID)_(エãƒ?‚£ãƒ?ƒˆå�?"
182             * ã�¨è¨?�†å½¢å¼�ã�«åŸºã�¥ã��ã?ç”»é�¢IDã�¨ã‚¨ãƒ?‚£ãƒ?ƒˆå��ç§°ã�®ãƒšã‚¢ã‚’å�–りå?ã�—ã�¾ã�™ã?
183             *
184             * ç”»é�¢IDã�¨ã‚¨ãƒ?‚£ãƒ?ƒˆå��ç§°ã�¯é…�å?ã�¨ã�—ã�¦ä¿�å­˜ã�•ã‚?インãƒ?ƒƒã‚¯ã‚¹ç•ªå�·ã�¯ 0:ç”»é�¢IDã€?:エãƒ?‚£ãƒ?ƒˆå�?
185             * ã��ã?ä¸?¦§ã�Œã�•れらã�«é…�å?ã�«æ ¼ç´�ã�•れã�¦è¿”ã�•れã�¾ã�™ã?
186             *
187             * @param keys キーé…�å?
188             *
189             * @return ç”»é�¢IDã�¨ã‚¨ãƒ?‚£ãƒ?ƒˆå��ç§°ã�®ãƒšã‚¢ã�®ä¸?¦§
190             */
191            public static String[][] getKeySet( final String[] keys ) {
192                    if( keys == null || keys.length == 0 ) { return null; }
193    
194                    Set<String[]> keySet = new HashSet<String[]>();
195                    for( String key : keys ) {
196                            if ( key != null && key.startsWith( "EDIT_NAME_" ) ) {
197                                    String guikeyEditName = key.substring( ( "EDIT_NAME_" ).length() );
198                                    if( guikeyEditName.indexOf( '_' ) >= 0 ) {
199                                            String guikey = guikeyEditName.substring( 0, guikeyEditName.indexOf( '_' ) );
200                                            String editName = guikeyEditName.substring( ( guikey + "_" ).length() );
201                                            if( guikey != null && guikey.length() > 0 && editName != null && editName.length() > 0 ) {
202                                                    String[] set = { guikey, editName };
203                                                    keySet.add( set );
204                                            }
205                                    }
206                            }
207                    }
208    //              return keySet.toArray( new String[0][] );
209                    return keySet.toArray( new String[keySet.size()][] );
210            }
211    
212            /**
213             * ç”»é�¢IDã€�エãƒ?‚£ãƒ?ƒˆå��をキーã�«ã€�エãƒ?‚£ãƒ?ƒˆè¨­å®šã‚ªãƒ–ジェクトã?å�?¨­å®šå?ã�®
214             * 管ç�?‚­ãƒ¼ã‚’指定ã�—ã�¾ã�™ã?
215             *
216             * エãƒ?‚£ãƒ?ƒˆè¨­å®šã‚ªãƒ–ジェクトã�§ç®¡ç�?�•れるå�?‚­ãƒ¼ã�«å¯¾ã�—ã�¦ã€?
217             * "EDIT_[KEY]_(ç”»é�¢ID)_(エãƒ?‚£ãƒ?ƒˆå�?"ã�¨ã�?�†ã‚­ãƒ¼ã‚’生æˆ�ã�—ã€�ã�“れをé…�å?ã�«ã�—ã�¦è¿”ã�—ã�¾ã�™ã?
218             *
219             * @param guikey 画�ID
220             * @param editName エãƒ?‚£ãƒ?ƒˆå�?
221             *
222             * @return エãƒ?‚£ãƒ?ƒˆè¨­å®šã‚’管ç�?�™ã‚‹ã�Ÿã‚�ã?キーä¸?¦§
223             */
224            public static String[] getEditKeys( final String guikey, final String editName ) {
225                    String[] rtn = new String[EDIT_KEYS_LENGTH];
226                    for( int i=0; i<EDIT_KEYS_LENGTH; i++ ) {
227                            rtn[i] = "EDIT_" + EDIT_KEYS[i] + "_" + guikey + "_" + editName;
228                    }
229                    return rtn;
230            }
231    
232            /**
233             * エãƒ?‚£ãƒ?ƒˆè¨­å®šã‚ªãƒ–ジェクトã?å�?¨­å®šå?ã‚’é?列ã�«ã�—ã�¦è¿”ã�—ã�¾ã�™ã?
234             *
235             * é…�å?ã�®ã‚¤ãƒ³ãƒ?ƒƒã‚¯ã‚¹ç•ªå�·ã�¯ã€�{@link #getEditKeys(String,String)}ã�§ç”Ÿæ?ã�•れるキーã�®
236             * インãƒ?ƒƒã‚¯ã‚¹ç•ªå�·ã�¨ä¸??ã�—ã�¾ã�™ã?
237             *
238             * @return エãƒ?‚£ãƒ?ƒˆè¨­å®šã‚ªãƒ–ジェクトã?設定å?ä¸?¦§(é…�å?)
239             * @see #getEditKeys(String,String)
240             */
241            public String[] getEditVals() {
242                    String[] rtn = new String[editVals.length];
243                    System.arraycopy( editVals, 0, rtn, 0, editVals.length );
244                    return rtn;
245            }
246    
247            /**
248             * エãƒ?‚£ãƒ?ƒˆå��ã‚’è¿”ã�—ã�¾ã�™ã?
249             *
250             * @return エãƒ?‚£ãƒ?ƒˆå�?
251             */
252            public String getEditName() {
253                    return editVals[EDIT_KEY_NAME];
254            }
255    
256            /**
257             * 表示カラãƒ?��ã�®ä¸?¦§ã‚’カンマ区åˆ?‚Šã�§è¿”ã�—ã�¾ã�™ã?
258             * é�žè¡¨ç¤ºã‚«ãƒ©ãƒ?�«ã�¤ã�?�¦ã�¯ã€�カラãƒ?��ã�®å…ˆé?ã�«"!"ã‚’ã�¤ã�‘ã�¦è¿”ã�•れã�¾ã�™ã?
259             * ä¾? AAA,!BBB,CCC â‡?AAA,CCCã�®é ?�«è¡¨ç¤º(BBBã�¯é�žè¡¨ç¤º)
260             *
261             * @return 表示カラãƒ?��ä¸?¦§(カンマ区åˆ?‚Š)
262             */
263            public String getViewClms() {
264                    return editVals[EDIT_KEY_VIEW];
265            }
266    
267            /**
268             * é›?¨ˆã‚«ãƒ©ãƒ??ä¸?¦§ã‚’カンマ区åˆ?‚Šã�§è¿”ã�—ã�¾ã�™ã?
269             *
270             * @return é›?¨ˆã‚«ãƒ©ãƒ??ä¸?¦§(カンマ区åˆ?
271             */
272            public String getSumClms() {
273                    return editVals[EDIT_KEY_SUM];
274            }
275    
276            /**
277             * é›?¨ˆå?ç�?‚’行ã�†ã�‹ã�©ã�?�‹ã‚’è¿”ã�—ã�¾ã�™ã?
278             * ã�“れã�¯ã€?›†è¨ˆã‚«ãƒ©ãƒ?�ŒæŒ?®šã�•れã�¦ã�?‚‹ã�‹ã?ã�¨å�Œã�˜æ„�味ã�§ã�™ã?
279             *
280             * @return true:対象 false:�対象
281             */
282            public boolean useSum() {
283                    return ( editVals[EDIT_KEY_SUM] != null && editVals[EDIT_KEY_SUM].length() > 0 );
284            }
285    
286            /**
287             * æŒ?®šã�•れã�Ÿã‚«ãƒ©ãƒ?�Œé›?¨ˆå¯¾è±¡ã�®ã‚«ãƒ©ãƒ?�‹ã�©ã�?�‹ã‚’è¿”ã�—ã�¾ã�™ã?
288             *
289             * @param clm カラ�
290             *
291             * @return true:対象 false:�対象
292             */
293            public boolean isSumClm( final String clm ) {
294                    if( clm == null || editVals[EDIT_KEY_SUM] == null ) { return false; }
295                    return ( ( ","+editVals[EDIT_KEY_SUM]+"," ).indexOf( ","+clm+"," ) >= 0 );
296            }
297    
298            /**
299             * é›?¨ˆã‚«ãƒ©ãƒ??カラãƒ?•°ã‚’è¿”ã�—ã�¾ã�™ã?
300             *
301             * @return é›?¨ˆã‚«ãƒ©ãƒ??カラãƒ?•°
302             */
303            public int getSumClmCount() {
304                    return sumClmCount;
305            }
306    
307            /**
308             * グループカラãƒ??ä¸?¦§ã‚’カンマ区åˆ?‚Šã�§è¿”ã�—ã�¾ã�™ã?
309             *
310             * @return グループカラãƒ??ä¸?¦§(カンマ区åˆ?
311             */
312            public String getGroupClms() {
313                    return editVals[EDIT_KEY_GROUP];
314            }
315    
316            /**
317             * グループå?ç�?‚’行ã�†ã�‹ã�©ã�?�‹ã‚’è¿”ã�—ã�¾ã�™ã?
318             * ã�“れã�¯ã€�グループカラãƒ?�ŒæŒ?®šã�•れã�¦ã�?‚‹ã�‹ã?ã�¨å�Œã�˜æ„�味ã�§ã�™ã?
319             *
320             * @return true:対象 false:�対象
321             */
322            public boolean useGroup() {
323                    return ( editVals[EDIT_KEY_GROUP] != null && editVals[EDIT_KEY_GROUP].length() > 0 );
324            }
325    
326            /**
327             * æŒ?®šã�•れã�Ÿã‚«ãƒ©ãƒ?�Œã‚°ãƒ«ãƒ¼ãƒ—対象ã�®ã‚«ãƒ©ãƒ?�‹ã�©ã�?�‹ã‚’è¿”ã�—ã�¾ã�™ã?
328             *
329             * @param clm カラ�
330             *
331             * @return true:対象 false:�対象
332             */
333            public boolean isGroupClm( final String clm ) {
334                    if( clm == null || editVals[EDIT_KEY_GROUP] == null ) { return false; }
335                    return ( ( ","+editVals[EDIT_KEY_GROUP]+"," ).indexOf( ","+clm+"," ) >= 0 );
336            }
337    
338            /**
339             * グループカラãƒ??カラãƒ?•°ã‚’è¿”ã�—ã�¾ã�™ã?
340             *
341             * @return グループカラãƒ??カラãƒ?•°
342             */
343            public int getGroupClmCount() {
344                    return groupClmCount;
345            }
346    
347            /**
348             * å°�計カラãƒ??ä¸?¦§ã‚’カンマ区åˆ?‚Šã�§è¿”ã�—ã�¾ã�™ã?
349             *
350             * @return å°�計カラãƒ??ä¸?¦§(カンマ区åˆ?
351             */
352            public String getSubTotalClms() {
353                    return editVals[EDIT_KEY_SUBTOTAL];
354            }
355    
356            /**
357             * å°�計å?ç�?‚’行ã�†ã�‹ã�©ã�?�‹ã‚’è¿”ã�—ã�¾ã�™ã?
358             * ã�“れã�¯ã€�å°�計カラãƒ?�ŒæŒ?®šã�•れã�¦ã�?‚‹ã�‹ã?ã�¨å�Œã�˜æ„�味ã�§ã�™ã?
359             *
360             * @return true:対象 false:�対象
361             */
362            public boolean useSubTotal() {
363                    return ( editVals[EDIT_KEY_SUBTOTAL] != null && editVals[EDIT_KEY_SUBTOTAL].length() > 0 );
364            }
365    
366            /**
367             * æŒ?®šã�•れã�Ÿã‚«ãƒ©ãƒ?�Œå°�計対象ã�®ã‚«ãƒ©ãƒ?�‹ã�©ã�?�‹ã‚’è¿”ã�—ã�¾ã�™ã?
368             *
369             * @param clm カラ�
370             *
371             * @return true:対象 false:�対象
372             */
373            public boolean isSubTotalClm( final String clm ) {
374                    if( clm == null || editVals[EDIT_KEY_SUBTOTAL] == null ) { return false; }
375                    return ( ( ","+editVals[EDIT_KEY_SUBTOTAL]+"," ).indexOf( ","+clm+"," ) >= 0 );
376            }
377    
378            /**
379             * å°�計カラãƒ??カラãƒ?•°ã‚’è¿”ã�—ã�¾ã�™ã?
380             *
381             * @return グループカラãƒ??カラãƒ?•°
382             */
383            public int getSubTotalClmCount() {
384                    return subTotalClmCount;
385            }
386    
387            /**
388             * å�ˆè¨ˆã‚«ãƒ©ãƒ??ä¸?¦§ã‚’カンマ区åˆ?‚Šã�§è¿”ã�—ã�¾ã�™ã?
389             *
390             * @return å�ˆè¨ˆã‚«ãƒ©ãƒ??ä¸?¦§(カンマ区åˆ?
391             */
392            public String getTotalClms() {
393                    return editVals[EDIT_KEY_TOTAL];
394            }
395    
396            /**
397             * å�ˆè¨ˆå?ç�?‚’行ã�†ã�‹ã�©ã�?�‹ã‚’è¿”ã�—ã�¾ã�™ã?
398             * ã�“れã�¯ã€�å�ˆè¨ˆã‚«ãƒ©ãƒ?�ŒæŒ?®šã�•れã�¦ã�?‚‹ã�‹ã?ã�¨å�Œã�˜æ„�味ã�§ã�™ã?
399             *
400             * @return true:対象 false:�対象
401             */
402            public boolean useTotal() {
403                    return ( editVals[EDIT_KEY_TOTAL] != null && editVals[EDIT_KEY_TOTAL].length() > 0 );
404            }
405    
406            /**
407             * æŒ?®šã�•れã�Ÿã‚«ãƒ©ãƒ?�Œå�ˆè¨ˆå¯¾è±¡ã�®ã‚«ãƒ©ãƒ?�‹ã�©ã�?�‹ã‚’è¿”ã�—ã�¾ã�™ã?
408             *
409             * @param clm カラ�
410             *
411             * @return true:対象 false:�対象
412             */
413            public boolean isTotalClm( final String clm ) {
414                    if( clm == null || editVals[EDIT_KEY_TOTAL] == null ) { return false; }
415                    return ( ( ","+editVals[EDIT_KEY_TOTAL]+"," ).indexOf( ","+clm+"," ) >= 0 );
416            }
417    
418            /**
419             * å�ˆè¨ˆã‚«ãƒ©ãƒ??カラãƒ?•°ã‚’è¿”ã�—ã�¾ã�™ã?
420             *
421             * @return グループカラãƒ??カラãƒ?•°
422             */
423            public int getTotalClmCount() {
424                    return totalClmCount;
425            }
426    
427            /**
428             * ç·�å�ˆè¨ˆè¡Œã‚’付加ã�™ã‚‹ã�‹ã�©ã�?�‹ã‚’è¿”ã�—ã�¾ã�™ã?
429             *
430             * @return true:対象 false:�対象
431             */
432            public boolean useGrandTotal() {
433                    return StringUtil.nval( editVals[EDIT_KEY_GRANDTOTAL], false );
434            }
435    
436            /**
437             * 表示é ?‚«ãƒ©ãƒ?‚’カンマ区åˆ?‚Šã�§è¿”ã�—ã�¾ã�™ã?
438             * カラãƒ??並ã�³é ?�Œè¡¨ç¤ºé ?�¨ã�—ã�¦ã�®å„ªå…ˆé?ã�«ã�ªã‚Šã�¾ã�™ã?
439             * ã�¾ã�Ÿã?é™�é?ã�§è¡¨ç¤ºã�™ã‚‹ã‚«ãƒ©ãƒ?�«ã�¤ã�?�¦ã�¯ã€�カラãƒ?��ã�®å…ˆé?ã�«"!"ã�Œä»˜åŠ ã�•れã�¾ã�™ã?
440             *
441             * @return 標準é?カラãƒ??ä¸?¦§(カンマ区åˆ?
442             */
443            public String getOrderByClms() {
444                    return editVals[EDIT_KEY_ORDERBY];
445            }
446    
447            /**
448             * æŒ?®šã�•れã�Ÿã‚«ãƒ©ãƒ??表示é ??優先番å�·ã‚’è¿”ã�—ã�¾ã�™ã?
449             * æŒ?®šã‚«ãƒ©ãƒ?�Œæ¨™æº–ã�¨ã�—ã�¦æŒ?®šã�•れã�¦ã�?�ªã�??å�ˆã?ã€?"(ゼロストリング)ã‚’è¿”ã�—ã�¾ã�™ã?
450             *
451             * @param clm カラ�
452             *
453             * @return 表示�?優先番�
454             */
455            public String getOrder( final String clm ) {
456                    if( clm == null || editVals[EDIT_KEY_ORDERBY] == null ) { return ""; }
457    
458                    String rtn = orderMap.get( clm );
459                    return ( rtn == null ? "" : rtn );
460            }
461    
462            /**
463             * æŒ?®šã�•れã�Ÿã‚«ãƒ©ãƒ??表示é ?Œ‡å®šã�Œé™�é?ã�§ã�‚ã‚‹ã�‹ã�©ã�?�‹ã‚’è¿”ã�—ã�¾ã�™ã?
464             * 標準ã�¨æŒ?®šã�•れã�¦ã�?�ªã�??å�ˆã?ã€�falseã‚’è¿”ã�—ã�¾ã�™ã?
465             *
466             * @param clm カラ�
467             *
468             * @return true:é™�é? false:æ˜??
469             */
470            public boolean isOrderByDesc( final String clm ) {
471                    if( clm == null || orderByDescClms == null ) { return false; }
472                    return ( ( ","+orderByDescClms+"," ).indexOf( ","+clm+"," ) >= 0 );
473            }
474    
475            /**
476             * 並ã�³æ›¿ã�ˆå?ç�?‚’行ã�†ã�‹ã�©ã�?�‹ã‚’è¿”ã�—ã�¾ã�™ã?
477             * ã�“れã�¯ã€�表示é ?‚«ãƒ©ãƒ?�ŒæŒ?®šã�•れã�¦ã�?‚‹ã�‹ã?ã�¨å�Œã�˜æ„�味ã�§ã�™ã?
478             *
479             * @return true:対象 false:�対象
480             */
481            public boolean useOrderBy() {
482                    return ( editVals[EDIT_KEY_ORDERBY] != null && editVals[EDIT_KEY_ORDERBY].length() > 0 );
483            }
484    
485            /**
486             * ã�“ã?エãƒ?‚£ãƒ?ƒˆè¨­å®šã‚ªãƒ–ジェクトã�Œã€�å?é€?全ユーザー公é–?エãƒ?‚£ãƒ?ƒˆã�?
487             * ã�©ã�?�‹ã‚’è¿”ã�—ã�¾ã�™ã?
488             *
489             * @return 0以�共�0:個人��
490             */
491            public boolean isCommon() {
492                    return StringUtil.nval( editVals[EDIT_KEY_COMMON], false );
493            }
494    }