File D:\maven-qcr-plugin-testsunitaires\qcr4java\h2-1.3.170-sources\target\site\qc\lecode\index\Cursor.java.html

1 /*
2 * Copyright 2004-2011 H2 Group. Multiple-Licensed under the H2 License,
3 * Version 1.0, and under the Eclipse Public License, Version 1.0
4 * (http://h2database.com/html/license.html).
5 * Initial Developer: H2 Group
6 */
7 package org.h2.index;
8
9 import org.h2.result.Row;
10 import org.h2.result.SearchRow;
11
12 /**
13 * A cursor is a helper object to iterate through an index.
14 * For indexes are sorted (such as the b tree index), it can iterate
15 * to the very end of the index. For other indexes that don't support
16 * that (such as a hash index), only one row is returned.
17 * The cursor is initially positioned before the first row, that means
18 * next() must be called before accessing data.
19 *
20 */
21 public interface Cursor {
22
23 /**
24 * Get the complete current row.
25 * All column are available.
26 *
27 * @return the complete row
28 */
29 Row get();
30
31 /**
32 * Get the current row.
33 * Only the data for indexed columns is available in this row.
34 *
35 * @return the search row
36 */
37 SearchRow getSearchRow();
38
39 /**
40 * Skip to the next row if one is available.
41 *
42 * @return true if another row is available
43 */
44 boolean next();
45
46 /**
47 * Skip to the previous row if one is available.
48 * No filtering is made here.
49 *
50 * @return true if another row is available
51 */
52 boolean previous();
53
54 }
55