org.h2.index
Interface Cursor

All Known Implementing Classes:
BtreeCursor, FunctionCursor, HashCursor, IndexCursor, LinkedCursor, MetaCursor, MultiVersionCursor, NonUniqueHashCursor, PageBtreeCursor, ScanCursor, TreeCursor, ViewCursor

public interface Cursor

A cursor is a helper object to iterate through an index. For indexes are sorted (such as the b tree index), it can iterate to the very end of the index. For other indexes that don't support that (such as a hash index), only one row is returned. The cursor is initially positioned before the first row, that means next() must be called before accessing data.


Method Summary
 Row get()
          Get the complete current row.
 long getKey()
          Get the unique key of the current row.
 SearchRow getSearchRow()
          Get the current row.
 boolean next()
          Skip to the next row if one is available.
 boolean previous()
          Skip to the previous row if one is available.
 

Method Detail

get

Row get()
        throws java.sql.SQLException
Get the complete current row. All column are available.

Returns:
the complete row
Throws:
java.sql.SQLException

getSearchRow

SearchRow getSearchRow()
                       throws java.sql.SQLException
Get the current row. Only the data for indexed columns is available in this row.

Returns:
the search row
Throws:
java.sql.SQLException

getKey

long getKey()
Get the unique key of the current row.

Returns:
the key

next

boolean next()
             throws java.sql.SQLException
Skip to the next row if one is available.

Returns:
true if another row is available
Throws:
java.sql.SQLException

previous

boolean previous()
                 throws java.sql.SQLException
Skip to the previous row if one is available. No filtering is made here.

Returns:
true if another row is available
Throws:
java.sql.SQLException