Class SqlJetCursor
- java.lang.Object
-
- org.tmatesoft.sqljet.core.internal.table.SqlJetCursor
-
- All Implemented Interfaces:
ISqlJetCursor
- Direct Known Subclasses:
SqlJetRowNumCursor
public abstract class SqlJetCursor extends java.lang.Object implements ISqlJetCursor
Base implementation ofISqlJetCursor.
-
-
Field Summary
Fields Modifier and Type Field Description protected ISqlJetBtreeTablebtreeTableprotected SqlJetDbdb
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidclose()Closes the cursor.booleaneof()Tests whether this cursor is positioned behind the last record.booleanfirst()Goes to the first record.byte[]getBlobAsArray(int field)Returns specified field's value as BLOB.java.io.InputStreamgetBlobAsStream(int field)Returns specified field's value as BLOB.booleangetBoolean(int field)Returns specified field's value as boolean.intgetFieldsCount()Returns number of fields in the current record.SqlJetValueTypegetFieldType(int field)Returns field type.doublegetFloat(int field)Returns specified field's value as float.longgetInteger(int field)Returns specified field's value as integer.java.lang.StringgetString(int field)Returns specified field's value as String.java.lang.ObjectgetValue(int field)Returns value of the field of the specified index in the current row.booleanisNull(int field)Tests field value for null.booleanlast()Goes to the last record.booleannext()Goes to the next record.booleanprevious()Goes to the previous record.ISqlJetCursorreverse()Returns cursor with the order reversed.-
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
delete, getBlobAsArray, getBlobAsStream, getBoolean, getFieldType, getFloat, getInteger, getLimit, getRowCount, getRowId, getRowIndex, getRowValues, getString, getValue, goTo, goToRow, isNull, setLimit, update, updateByFieldNames, updateByFieldNamesOr, updateOr, updateWithRowId, updateWithRowIdOr
-
-
-
-
Field Detail
-
btreeTable
protected final ISqlJetBtreeTable btreeTable
-
db
protected final SqlJetDb db
-
-
Method Detail
-
close
public void close() throws SqlJetExceptionDescription copied from interface:ISqlJetCursorCloses the cursor.- Specified by:
closein interfaceISqlJetCursor- Throws:
SqlJetException
-
eof
public boolean eof() throws SqlJetExceptionDescription copied from interface:ISqlJetCursorTests whether this cursor is positioned behind the last record.- Specified by:
eofin interfaceISqlJetCursor- Returns:
- true if the cursor is not on a record and fields can't be read.
- Throws:
SqlJetException
-
first
public boolean first() throws SqlJetExceptionDescription copied from interface:ISqlJetCursorGoes to the first record.- Specified by:
firstin interfaceISqlJetCursor- Returns:
- true if there is at least one record.
- Throws:
SqlJetException
-
last
public boolean last() throws SqlJetExceptionDescription copied from interface:ISqlJetCursorGoes to the last record.- Specified by:
lastin interfaceISqlJetCursor- Returns:
- true if there is at least one record.
- Throws:
SqlJetException
-
next
public boolean next() throws SqlJetExceptionDescription copied from interface:ISqlJetCursorGoes to the next record.- Specified by:
nextin interfaceISqlJetCursor- Returns:
- true if there is at least one record and end of cursor is not reached yet
- Throws:
SqlJetException
-
previous
public boolean previous() throws SqlJetExceptionDescription copied from interface:ISqlJetCursorGoes to the previous record.- Specified by:
previousin interfaceISqlJetCursor- Returns:
- true if there is at least one record and begin of cursor is not reached yet
- Throws:
SqlJetException
-
getFieldsCount
public int getFieldsCount() throws SqlJetExceptionDescription copied from interface:ISqlJetCursorReturns number of fields in the current record.- Specified by:
getFieldsCountin interfaceISqlJetCursor- Throws:
SqlJetException
-
getFieldType
public SqlJetValueType getFieldType(int field) throws SqlJetException
Description copied from interface:ISqlJetCursorReturns field type.- Specified by:
getFieldTypein interfaceISqlJetCursor- Parameters:
field- index of the field- Returns:
- type of field
- Throws:
SqlJetException
-
isNull
public boolean isNull(int field) throws SqlJetExceptionDescription copied from interface:ISqlJetCursorTests field value for null.- Specified by:
isNullin interfaceISqlJetCursor- Parameters:
field- number of field begin from zero- Returns:
- true if field value is null
- Throws:
SqlJetException
-
getString
public java.lang.String getString(int field) throws SqlJetExceptionDescription copied from interface:ISqlJetCursorReturns specified field's value as String.- Specified by:
getStringin interfaceISqlJetCursor- Parameters:
field- index of the field- Returns:
- field's value as string
- Throws:
SqlJetException
-
getInteger
public long getInteger(int field) throws SqlJetExceptionDescription copied from interface:ISqlJetCursorReturns specified field's value as integer.- Specified by:
getIntegerin interfaceISqlJetCursor- Parameters:
field- index of the field- Returns:
- field's value as integer
- Throws:
SqlJetException
-
getFloat
public double getFloat(int field) throws SqlJetExceptionDescription copied from interface:ISqlJetCursorReturns specified field's value as float.- Specified by:
getFloatin interfaceISqlJetCursor- Parameters:
field- index of the field- Returns:
- field's value as real
- Throws:
SqlJetException
-
getBlobAsArray
public byte[] getBlobAsArray(int field) throws SqlJetExceptionDescription copied from interface:ISqlJetCursorReturns specified field's value as BLOB.- Specified by:
getBlobAsArrayin interfaceISqlJetCursor- Parameters:
field- index of the field- Returns:
- field's value as BLOB
- Throws:
SqlJetException
-
getBlobAsStream
public java.io.InputStream getBlobAsStream(int field) throws SqlJetExceptionDescription copied from interface:ISqlJetCursorReturns specified field's value as BLOB.- Specified by:
getBlobAsStreamin interfaceISqlJetCursor- Parameters:
field- number of field begin from zero- Returns:
- field's value as BLOB
- Throws:
SqlJetException
-
getValue
public java.lang.Object getValue(int field) throws SqlJetExceptionDescription copied from interface:ISqlJetCursorReturns value of the field of the specified index in the current row.- Specified by:
getValuein interfaceISqlJetCursor- Parameters:
field- index of the field- Throws:
SqlJetException
-
getBoolean
public boolean getBoolean(int field) throws SqlJetExceptionDescription copied from interface:ISqlJetCursorReturns specified field's value as boolean.- Specified by:
getBooleanin interfaceISqlJetCursor- Parameters:
field- index of the field- Returns:
- field value
- Throws:
SqlJetException
-
reverse
public ISqlJetCursor reverse() throws SqlJetException
Description copied from interface:ISqlJetCursorReturns cursor with the order reversed.- Specified by:
reversein interfaceISqlJetCursor- Returns:
- cursor that will traverse the same rows as this one, but in reversed order.
- Throws:
SqlJetException
-
-