01: /*
02: * Copyright 2004-2008 H2 Group. Licensed under the H2 License, Version 1.0
03: * (http://h2database.com/html/license.html).
04: * Initial Developer: H2 Group
05: */
06: package org.h2.index;
07:
08: import java.sql.SQLException;
09:
10: import org.h2.result.Row;
11: import org.h2.result.SearchRow;
12:
13: /**
14: * The cursor implementation for the linear hash index.
15: */
16: public class LinearHashCursor implements Cursor {
17: private Row row;
18: private boolean end;
19:
20: LinearHashCursor(Row row) {
21: this .row = row;
22: }
23:
24: public Row get() {
25: return row;
26: }
27:
28: public SearchRow getSearchRow() throws SQLException {
29: return row;
30: }
31:
32: public int getPos() {
33: return row.getPos();
34: }
35:
36: public boolean next() {
37: if (row == null || end) {
38: row = null;
39: return false;
40: }
41: end = true;
42: return true;
43: }
44:
45: }
|