View Javadoc

1   /***
2    *  The contents of this file are subject to the Mozilla Public
3    *  License Version 1.1 (the "License"); you may not use this file
4    *  except in compliance with the License. You may obtain a copy of
5    *  the License at http://www.mozilla.org/MPL/
6    *
7    *  Software distributed under the License is distributed on an "AS
8    *  IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or
9    *  implied. See the License for the specific language governing
10   *  rights and limitations under the License.
11   *
12   *  The Original Code is pow2toolkit library.
13   *
14   *  The Initial Owner of the Original Code is
15   *  Claudio Fratarcangeli
16   *
17   *  Portions created by Power Of Two S.R.L. are
18   *  Copyright (C) Power Of Two S.R.L.
19   *  All Rights Reserved.
20   *
21   * Contributor(s):
22   */
23  
24  package com.pow2.dao.datalist;
25  
26  /***
27   *  DataList interface.
28   *  <br>
29   *  Represent a collection of data.
30   *
31   * @author  Claudio Fratarcangeli
32   * @created  5 dicembre 2002
33   */
34  public interface DataList
35  {
36    /***
37     *  Get the DataListIterator object.
38     *
39     * @return  the DataListIterator object
40     * @exception Exception if any error occurs
41     */
42    public DataListIterator iterator() throws Exception;
43  
44  
45    /***
46     *  Close the data list.
47     *
48     * @exception Exception if any error occurs
49     */
50    public void close() throws Exception;
51  
52  
53    /***
54     *  Get the object at the <code>index</code> position.
55     *
56     * @param  index list index
57     * @param  object the object to fill with data
58     * @return  the object at the <code>index</code> position
59     * @exception Exception if any error occurs
60     */
61    public Object get(int index, Object object) throws Exception;
62  
63  
64    /***
65     *  Check if the data list is empty.
66     *
67     * @return  true if the data list is empty; false otherwise.
68     * @exception Exception if any error occurs
69     */
70    public boolean isEmpty() throws Exception;
71  }