KickJava   Java API By Example, From Geeks To Geeks.

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


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
7 import java.util.Collection JavaDoc ;
8 import java.util.Iterator JavaDoc ;
9 /**
10  * Jun 30, 2004
11  * @author: Tuan Nguyen
12  * @email: tuan08@users.sourceforge.net
13  * @version: $Id: CollectionDataHandler.java,v 1.1 2004/07/31 14:46:58 tuan08 Exp $
14  */

15 abstract public class CollectionDataHandler implements DataHandler {
16   protected Collection JavaDoc datas_ ;
17   protected Iterator JavaDoc iterator_ ;
18   
19   public CollectionDataHandler() {
20   }
21   
22   public CollectionDataHandler setDatas(Collection JavaDoc datas) {
23     datas_ = datas ;
24     return this ;
25   }
26   
27   public void begin() { iterator_ = datas_.iterator(); }
28   public void end() { iterator_ = null ; }
29   
30   public boolean nextRow() {
31     boolean test = iterator_.hasNext();
32     if(test) {
33         setCurrentObject(iterator_.next()) ;
34     }
35     return test ;
36   }
37   
38   public Object JavaDoc getCurrentObject() { return iterator_.next() ; }
39   public String JavaDoc getCurrentObjectId() { return null ; }
40 }
Popular Tags