KickJava   Java API By Example, From Geeks To Geeks.

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


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.message.Message;
10 import org.h2.result.LocalResult;
11 import org.h2.result.Row;
12
13 public class FunctionCursor implements Cursor {
14     
15     private LocalResult result;
16     private Row row;
17     
18     FunctionCursor(LocalResult result) {
19         this.result = result;
20     }
21
22     public Row get() {
23         return row;
24     }
25     
26     public int getPos() {
27         throw Message.getInternalError();
28     }
29
30     public boolean next() throws SQLException JavaDoc {
31         if(result.next()) {
32             row = new Row(result.currentRow());
33         } else {
34             row = null;
35         }
36         return row != null;
37     }
38
39 }
40
Popular Tags