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
.- Author:
- TMate Software Ltd., Sergey Scherbina (sergey.scherbina@gmail.com)
-
-
Field Summary
Fields Modifier and Type Field Description protected ISqlJetBtreeTable
btreeTable
protected SqlJetDb
db
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
close()
Closes the cursor.boolean
eof()
Tests whether this cursor is positioned behind the last record.boolean
first()
Goes to the first record.byte[]
getBlobAsArray(int field)
Returns specified field's value as BLOB.java.io.InputStream
getBlobAsStream(int field)
Returns specified field's value as BLOB.boolean
getBoolean(int field)
Returns specified field's value as boolean.int
getFieldsCount()
Returns number of fields in the current record.SqlJetValueType
getFieldType(int field)
Returns field type.double
getFloat(int field)
Returns specified field's value as float.long
getInteger(int field)
Returns specified field's value as integer.java.lang.String
getString(int field)
Returns specified field's value as String.java.lang.Object
getValue(int field)
Returns value of the field of the specified index in the current row.boolean
isNull(int field)
Tests field value for null.boolean
last()
Goes to the last record.boolean
next()
Goes to the next record.boolean
previous()
Goes to the previous record.ISqlJetCursor
reverse()
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 SqlJetException
Description copied from interface:ISqlJetCursor
Closes the cursor.- Specified by:
close
in interfaceISqlJetCursor
- 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
- Returns:
- true if the cursor is not on a record and fields can't be read.
- Throws:
SqlJetException
-
first
public boolean first() throws SqlJetException
Description copied from interface:ISqlJetCursor
Goes to the first record.- Specified by:
first
in interfaceISqlJetCursor
- Returns:
- true if there is at least one record.
- Throws:
SqlJetException
-
last
public boolean last() throws SqlJetException
Description copied from interface:ISqlJetCursor
Goes to the last record.- Specified by:
last
in interfaceISqlJetCursor
- 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
- 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
- Returns:
- true if there is at least one record and begin of cursor is not reached yet
- Throws:
SqlJetException
-
getFieldsCount
public int getFieldsCount() throws SqlJetException
Description copied from interface:ISqlJetCursor
Returns number of fields in the current record.- Specified by:
getFieldsCount
in interfaceISqlJetCursor
- Throws:
SqlJetException
-
getFieldType
public SqlJetValueType getFieldType(int field) throws SqlJetException
Description copied from interface:ISqlJetCursor
Returns field type.- Specified by:
getFieldType
in interfaceISqlJetCursor
- Parameters:
field
- index of the field- Returns:
- type of field
- Throws:
SqlJetException
-
isNull
public boolean isNull(int field) throws SqlJetException
Description copied from interface:ISqlJetCursor
Tests field value for null.- Specified by:
isNull
in 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 SqlJetException
Description copied from interface:ISqlJetCursor
Returns specified field's value as String.- Specified by:
getString
in interfaceISqlJetCursor
- Parameters:
field
- index of the field- Returns:
- field's value as string
- Throws:
SqlJetException
-
getInteger
public long getInteger(int field) throws SqlJetException
Description copied from interface:ISqlJetCursor
Returns specified field's value as integer.- Specified by:
getInteger
in interfaceISqlJetCursor
- Parameters:
field
- index of the field- Returns:
- field's value as integer
- Throws:
SqlJetException
-
getFloat
public double getFloat(int field) throws SqlJetException
Description copied from interface:ISqlJetCursor
Returns specified field's value as float.- Specified by:
getFloat
in interfaceISqlJetCursor
- Parameters:
field
- index of the field- Returns:
- field's value as real
- Throws:
SqlJetException
-
getBlobAsArray
public byte[] getBlobAsArray(int field) throws SqlJetException
Description copied from interface:ISqlJetCursor
Returns specified field's value as BLOB.- Specified by:
getBlobAsArray
in interfaceISqlJetCursor
- Parameters:
field
- index of the field- Returns:
- field's value as BLOB
- Throws:
SqlJetException
-
getBlobAsStream
public java.io.InputStream getBlobAsStream(int field) throws SqlJetException
Description copied from interface:ISqlJetCursor
Returns specified field's value as BLOB.- Specified by:
getBlobAsStream
in 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 SqlJetException
Description copied from interface:ISqlJetCursor
Returns value of the field of the specified index in the current row.- Specified by:
getValue
in interfaceISqlJetCursor
- Parameters:
field
- index of the field- Throws:
SqlJetException
-
getBoolean
public boolean getBoolean(int field) throws SqlJetException
Description copied from interface:ISqlJetCursor
Returns specified field's value as boolean.- Specified by:
getBoolean
in interfaceISqlJetCursor
- Parameters:
field
- index of the field- Returns:
- field value
- Throws:
SqlJetException
-
reverse
public ISqlJetCursor reverse() throws SqlJetException
Description copied from interface:ISqlJetCursor
Returns cursor with the order reversed.- Specified by:
reverse
in interfaceISqlJetCursor
- Returns:
- cursor that will traverse the same rows as this one, but in reversed order.
- Throws:
SqlJetException
-
-