KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > exoplatform > faces > core > component > model > ListDataHandler


1 /***************************************************************************
2  * Copyright 2001-2003 The eXo Platform SARL All rights reserved. *
3  * Please look at license.txt in info directory for more license detail. *
4  **************************************************************************/

5 package org.exoplatform.faces.core.component.model;
6 import java.util.List JavaDoc;
7 /**
8  * Jun 30, 2004
9  * @author: Tuan Nguyen
10  * @email: tuan08@users.sourceforge.net
11  * @version: $Id: ListDataHandler.java,v 1.6 2004/11/03 04:24:53 tuan08 Exp $
12  */

13 abstract public class ListDataHandler implements DataHandler {
14   protected List JavaDoc datas_;
15   protected int currentRow_;
16   
17   public ListDataHandler() {
18
19   }
20
21   public ListDataHandler setDatas(List JavaDoc datas) {
22     datas_ = datas;
23     return this;
24   }
25
26   public void begin() {
27     currentRow_ = -1;
28   }
29
30   public void end() {
31   }
32
33   public boolean nextRow() {
34     currentRow_++;
35     if (datas_ != null) {
36       if (currentRow_ < datas_.size()) {
37         setCurrentObject(datas_.get(currentRow_));
38         return true;
39       }
40     }
41     return false;
42   }
43
44   public int getCurrentRow() { return currentRow_; }
45
46   public Object JavaDoc getCurrentObject() { return datas_.get(currentRow_); }
47
48   public String JavaDoc getCurrentObjectId() { return null; }
49
50   public Object JavaDoc getObject(int index) { return datas_.get(index); }
51   
52   public List JavaDoc getDatas() { return datas_ ; }
53 }
Popular Tags