KickJava   Java API By Example, From Geeks To Geeks.

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


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 org.h2.result.Row;
8
9 /**
10  * @author Thomas
11  */

12 public class HashCursor implements Cursor {
13     private Row row;
14     private boolean end;
15
16     HashCursor(Row row) {
17         this.row = row;
18     }
19
20     public Row get() {
21         return row;
22     }
23     
24     public int getPos() {
25         return row == null ? -1 : row.getPos();
26     }
27
28     public boolean next() {
29         if(row==null || end) {
30             row = null;
31             return false;
32         }
33         end = true;
34         return true;
35     }
36 }
37
Popular Tags