KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > alfresco > web > ui > common > component > data > GridArrayDataModel


1 /*
2  * Copyright (C) 2005 Alfresco, Inc.
3  *
4  * Licensed under the Mozilla Public License version 1.1
5  * with a permitted attribution clause. You may obtain a
6  * copy of the License at
7  *
8  * http://www.alfresco.org/legal/license.txt
9  *
10  * Unless required by applicable law or agreed to in writing,
11  * software distributed under the License is distributed on an
12  * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND,
13  * either express or implied. See the License for the specific
14  * language governing permissions and limitations under the
15  * License.
16  */

17 package org.alfresco.web.ui.common.component.data;
18
19 /**
20  * @author kevinr
21  */

22 public class GridArrayDataModel implements IGridDataModel
23 {
24    /**
25     * Constructor
26     *
27     * @param data Array of Object (beans) row data
28     */

29    public GridArrayDataModel(Object JavaDoc[] data)
30    {
31       this.data = data;
32    }
33    
34    /**
35     * Get a row object for the specified row index
36     *
37     * @param index valid row index
38     *
39     * @return row object for the specified index
40     */

41    public Object JavaDoc getRow(int index)
42    {
43       return this.data[index];
44    }
45    
46    /**
47     * Return the number of rows in the data model
48     *
49     * @return row count
50     */

51    public int size()
52    {
53       return this.data.length;
54    }
55    
56    /**
57     * Sort the data set using the specified sort parameters
58     *
59     * @param column Column to sort
60     * @param descending True for descending sort, false for ascending
61     * @param mode Sort mode to use (see IDataContainer constants)
62     */

63    public void sort(String JavaDoc column, boolean descending, String JavaDoc mode)
64    {
65    }
66    
67    private Object JavaDoc[] data = null;
68 }
69
Popular Tags