Class SqlJetRowNumCursor
- java.lang.Object
-
- org.tmatesoft.sqljet.core.internal.table.SqlJetCursor
-
- org.tmatesoft.sqljet.core.internal.table.SqlJetRowNumCursor
-
- All Implemented Interfaces:
ISqlJetCursor
- Direct Known Subclasses:
SqlJetTableDataCursor
public abstract class SqlJetRowNumCursor extends SqlJetCursor
- Author:
- TMate Software Ltd., Sergey Scherbina (sergey.scherbina@gmail.com)
-
-
Field Summary
-
Fields inherited from class org.tmatesoft.sqljet.core.internal.table.SqlJetCursor
btreeTable, db
-
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected void
computeRows(boolean current)
void
delete()
Deletes the current record.boolean
eof()
Tests whether this cursor is positioned behind the last record.boolean
first()
Goes to the first record.protected boolean
firstRowNum(boolean first)
long
getLimit()
Returns limit of this cursor.long
getRowCount()
Returns number of rows accessible with this cursor.long
getRowIndex()
Returns index of the current row.boolean
goToRow(long rowNum)
Goes to the row with the specified index.boolean
last()
Goes to the last record.protected boolean
lastRowNum(boolean last)
boolean
next()
Goes to the next record.protected boolean
nextRowNum(boolean next)
boolean
previous()
Goes to the previous record.protected boolean
previousRowNum(boolean previous)
void
setLimit(long limit)
Sets limit for this cursor.-
Methods inherited from class org.tmatesoft.sqljet.core.internal.table.SqlJetCursor
close, getBlobAsArray, getBlobAsStream, getBoolean, getFieldsCount, getFieldType, getFloat, getInteger, getString, getValue, isNull, reverse
-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface org.tmatesoft.sqljet.core.table.ISqlJetCursor
getBlobAsArray, getBlobAsStream, getBoolean, getFieldType, getFloat, getInteger, getRowId, getRowValues, getString, getValue, goTo, isNull, update, updateByFieldNames, updateByFieldNamesOr, updateOr, updateWithRowId, updateWithRowIdOr
-
-
-
-
Method Detail
-
setLimit
public void setLimit(long limit) throws SqlJetException
Description copied from interface:ISqlJetCursor
Sets limit for this cursor. Negative or zero value resets limit to infinity.- Parameters:
limit
- the limit to set- Throws:
SqlJetException
-
getLimit
public long getLimit()
Description copied from interface:ISqlJetCursor
Returns limit of this cursor.- Returns:
- the limit
-
getRowCount
public long getRowCount() throws SqlJetException
Description copied from interface:ISqlJetCursor
Returns number of rows accessible with this cursor.- Returns:
- number of rows
- Throws:
SqlJetException
-
computeRows
protected void computeRows(boolean current) throws SqlJetException
- Throws:
SqlJetException
-
getRowIndex
public long getRowIndex() throws SqlJetException
Description copied from interface:ISqlJetCursor
Returns index of the current row. Index is 1-based, first record has index of one.- Returns:
- 1-based index of the current row.
- Throws:
SqlJetException
-
goToRow
public boolean goToRow(long rowNum) throws SqlJetException
Description copied from interface:ISqlJetCursor
Goes to the row with the specified index. Index is 1-based, first record has index of one.- Returns:
- true if cursor has been set on the specified record.
- Throws:
SqlJetException
-
delete
public void delete() throws SqlJetException
Description copied from interface:ISqlJetCursor
Deletes the current record.- Throws:
SqlJetException
-
first
public boolean first() throws SqlJetException
Description copied from interface:ISqlJetCursor
Goes to the first record.- Specified by:
first
in interfaceISqlJetCursor
- Overrides:
first
in classSqlJetCursor
- Returns:
- true if there is at least one record.
- Throws:
SqlJetException
-
next
public boolean next() throws SqlJetException
Description copied from interface:ISqlJetCursor
Goes to the next record.- Specified by:
next
in interfaceISqlJetCursor
- Overrides:
next
in classSqlJetCursor
- Returns:
- true if there is at least one record and end of cursor is not reached yet
- Throws:
SqlJetException
-
previous
public boolean previous() throws SqlJetException
Description copied from interface:ISqlJetCursor
Goes to the previous record.- Specified by:
previous
in interfaceISqlJetCursor
- Overrides:
previous
in classSqlJetCursor
- Returns:
- true if there is at least one record and begin of cursor is not reached yet
- Throws:
SqlJetException
-
last
public boolean last() throws SqlJetException
Description copied from interface:ISqlJetCursor
Goes to the last record.- Specified by:
last
in interfaceISqlJetCursor
- Overrides:
last
in classSqlJetCursor
- Returns:
- true if there is at least one record.
- Throws:
SqlJetException
-
firstRowNum
protected boolean firstRowNum(boolean first) throws SqlJetException
- Throws:
SqlJetException
-
nextRowNum
protected boolean nextRowNum(boolean next) throws SqlJetException
- Throws:
SqlJetException
-
previousRowNum
protected boolean previousRowNum(boolean previous) throws SqlJetException
- Throws:
SqlJetException
-
lastRowNum
protected boolean lastRowNum(boolean last) throws SqlJetException
- Throws:
SqlJetException
-
eof
public boolean eof() throws SqlJetException
Description copied from interface:ISqlJetCursor
Tests whether this cursor is positioned behind the last record.- Specified by:
eof
in interfaceISqlJetCursor
- Overrides:
eof
in classSqlJetCursor
- Returns:
- true if the cursor is not on a record and fields can't be read.
- Throws:
SqlJetException
-
-