KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > h2 > index > ScanCursor


1 /*
2  * Copyright 2004-2006 H2 Group. Licensed under the H2 License, Version 1.0 (http://h2database.com/html/license.html).
3  * Initial Developer: H2 Group
4  */

5 package org.h2.index;
6
7 import java.sql.SQLException JavaDoc;
8
9 import org.h2.result.Row;
10
11
12 /**
13  * @author Thomas
14  */

15 public class ScanCursor implements Cursor {
16     private ScanIndex scan;
17     private Row row;
18
19     ScanCursor(ScanIndex scan) {
20         this.scan = scan;
21         row = null;
22     }
23
24     public Row get() {
25         return row;
26     }
27     
28     public int getPos() {
29         return row == null ? -1 : row.getPos();
30     }
31
32     public boolean next() throws SQLException JavaDoc {
33         row = scan.getNextRow(row);
34         return row != null;
35     }
36 }
37
Popular Tags