KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > apache > myfaces > component > html > ext > _SerializableResultDataModel


1 /*
2  * Copyright 2004 The Apache Software Foundation.
3  *
4  * Licensed under the Apache License, Version 2.0 (the "License");
5  * you may not use this file except in compliance with the License.
6  * You may obtain a copy of the License at
7  *
8  * http://www.apache.org/licenses/LICENSE-2.0
9  *
10  * Unless required by applicable law or agreed to in writing, software
11  * distributed under the License is distributed on an "AS IS" BASIS,
12  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13  * See the License for the specific language governing permissions and
14  * limitations under the License.
15  */

16 package org.apache.myfaces.component.html.ext;
17
18 import java.util.ArrayList JavaDoc;
19 import java.util.SortedMap JavaDoc;
20
21 /**
22  * @author Manfred Geiler (latest modification by $Author: matze $)
23  * @version $Revision: 1.3 $ $Date: 2004/10/13 11:50:57 $
24  */

25 class _SerializableResultDataModel
26         extends _SerializableDataModel
27 {
28     //private static final Log log = LogFactory.getLog(_SerializableDataModel.class);
29

30     public _SerializableResultDataModel(int first, int rows, javax.servlet.jsp.jstl.sql.Result result)
31     {
32         _first = first;
33         _rows = rows;
34         _rowCount = result.getRowCount();
35         if (_rows <= 0)
36         {
37             _rows = _rowCount - first;
38         }
39         _list = new ArrayList JavaDoc(_rows);
40         SortedMap JavaDoc[] resultRows = result.getRows();
41         for (int i = 0; i < _rowCount; i++)
42         {
43             _list.add(resultRows[_first + i]);
44         }
45     }
46
47 }
48
Popular Tags