Class SqlJetReverseOrderCursor
- java.lang.Object
-
- org.tmatesoft.sqljet.core.internal.table.SqlJetReverseOrderCursor
-
- All Implemented Interfaces:
ISqlJetCursor
public class SqlJetReverseOrderCursor extends java.lang.Object implements ISqlJetCursor
-
-
Constructor Summary
Constructors Constructor Description SqlJetReverseOrderCursor(ISqlJetCursor cursor)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidclose()Closes the cursor.voiddelete()Deletes the current record.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.byte[]getBlobAsArray(java.lang.String fieldName)Returns specified field's value as BLOB.java.io.InputStreamgetBlobAsStream(int field)Returns specified field's value as BLOB.java.io.InputStreamgetBlobAsStream(java.lang.String fieldName)Returns specified field's value as BLOB.booleangetBoolean(int field)Returns specified field's value as boolean.booleangetBoolean(java.lang.String fieldName)Returns specified field's value as boolean.intgetFieldsCount()Returns number of fields in the current record.SqlJetValueTypegetFieldType(int field)Returns field type.SqlJetValueTypegetFieldType(java.lang.String fieldName)Returns field type.doublegetFloat(int field)Returns specified field's value as float.doublegetFloat(java.lang.String fieldName)Returns specified field's value as float.longgetInteger(int field)Returns specified field's value as integer.longgetInteger(java.lang.String fieldName)Returns specified field's value as integer.longgetLimit()Returns limit of this cursor.longgetRowCount()Returns number of rows accessible with this cursor.longgetRowId()Gets row Id of the current record.longgetRowIndex()Returns index of the current row.java.lang.Object[]getRowValues()Returns all field values of current row.java.lang.StringgetString(int field)Returns specified field's value as String.java.lang.StringgetString(java.lang.String fieldName)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.java.lang.ObjectgetValue(java.lang.String fieldName)Returns value of the field with the specified name in the current row.booleangoTo(long rowId)Goes to the record with the specified row Id.booleangoToRow(long rowIndex)Goes to the row with the specified index.booleanisNull(int field)Tests field value for null.booleanisNull(java.lang.String fieldName)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.voidsetLimit(long limit)Sets limit for this cursor.voidupdate(java.lang.Object... values)Updates the current record.voidupdateByFieldNames(java.util.Map<java.lang.String,java.lang.Object> values)Updates the current record.voidupdateByFieldNamesOr(SqlJetConflictAction onConflict, java.util.Map<java.lang.String,java.lang.Object> values)Updates the current record.voidupdateOr(SqlJetConflictAction onConflict, java.lang.Object... values)Updates the current record.longupdateWithRowId(long rowId, java.lang.Object... values)Updates rowId and values in the current record.longupdateWithRowIdOr(SqlJetConflictAction onConflict, long rowId, java.lang.Object... values)Updates rowId and values in the current record.
-
-
-
Constructor Detail
-
SqlJetReverseOrderCursor
public SqlJetReverseOrderCursor(ISqlJetCursor cursor) throws SqlJetException
- Throws:
SqlJetException
-
-
Method Detail
-
close
public void close() throws SqlJetExceptionDescription copied from interface:ISqlJetCursorCloses the cursor.- Specified by:
closein interfaceISqlJetCursor- Throws:
SqlJetException
-
delete
public void delete() throws SqlJetExceptionDescription copied from interface:ISqlJetCursorDeletes the current record.- Specified by:
deletein 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
-
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
-
getBlobAsArray
public byte[] getBlobAsArray(java.lang.String fieldName) throws SqlJetExceptionDescription copied from interface:ISqlJetCursorReturns specified field's value as BLOB.- Specified by:
getBlobAsArrayin interfaceISqlJetCursor- Parameters:
fieldName- name 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
-
getBlobAsStream
public java.io.InputStream getBlobAsStream(java.lang.String fieldName) throws SqlJetExceptionDescription copied from interface:ISqlJetCursorReturns specified field's value as BLOB.- Specified by:
getBlobAsStreamin interfaceISqlJetCursor- Parameters:
fieldName- name of the field- Returns:
- field's value as BLOB
- 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
-
getBoolean
public boolean getBoolean(java.lang.String fieldName) throws SqlJetExceptionDescription copied from interface:ISqlJetCursorReturns specified field's value as boolean.- Specified by:
getBooleanin interfaceISqlJetCursor- Parameters:
fieldName- name of the field- Returns:
- field value
- 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
-
getFieldType
public SqlJetValueType getFieldType(java.lang.String fieldName) throws SqlJetException
Description copied from interface:ISqlJetCursorReturns field type.- Specified by:
getFieldTypein interfaceISqlJetCursor- Parameters:
fieldName- name of the field- Returns:
- type of field
- 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
-
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
-
getFloat
public double getFloat(java.lang.String fieldName) throws SqlJetExceptionDescription copied from interface:ISqlJetCursorReturns specified field's value as float.- Specified by:
getFloatin interfaceISqlJetCursor- Parameters:
fieldName- name of the field- 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
-
getInteger
public long getInteger(java.lang.String fieldName) throws SqlJetExceptionDescription copied from interface:ISqlJetCursorReturns specified field's value as integer.- Specified by:
getIntegerin interfaceISqlJetCursor- Parameters:
fieldName- name of the field- Throws:
SqlJetException
-
getRowId
public long getRowId() throws SqlJetExceptionDescription copied from interface:ISqlJetCursorGets row Id of the current record.- Specified by:
getRowIdin interfaceISqlJetCursor- Returns:
- row Id of the current record.
- 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
-
getString
public java.lang.String getString(java.lang.String fieldName) throws SqlJetExceptionDescription copied from interface:ISqlJetCursorReturns specified field's value as String.- Specified by:
getStringin interfaceISqlJetCursor- Parameters:
fieldName- name of the field- Returns:
- field's value as string
- 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
-
getValue
public java.lang.Object getValue(java.lang.String fieldName) throws SqlJetExceptionDescription copied from interface:ISqlJetCursorReturns value of the field with the specified name in the current row.- Specified by:
getValuein interfaceISqlJetCursor- Parameters:
fieldName- name of the field- Throws:
SqlJetException
-
goTo
public boolean goTo(long rowId) throws SqlJetExceptionDescription copied from interface:ISqlJetCursorGoes to the record with the specified row Id.- Specified by:
goToin interfaceISqlJetCursor- Parameters:
rowId- row Id- Returns:
- true if cursor was moved successfully.
- 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
-
isNull
public boolean isNull(java.lang.String fieldName) throws SqlJetExceptionDescription copied from interface:ISqlJetCursorTests field value for null.- Specified by:
isNullin interfaceISqlJetCursor- Returns:
- true if field value is null
- 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
-
update
public void update(java.lang.Object... values) throws SqlJetExceptionDescription copied from interface:ISqlJetCursorUpdates the current record.- Specified by:
updatein interfaceISqlJetCursor- Parameters:
values- New record values.- Throws:
SqlJetException
-
updateOr
public void updateOr(SqlJetConflictAction onConflict, java.lang.Object... values) throws SqlJetException
Description copied from interface:ISqlJetCursorUpdates the current record. Implements ON CONFLICT clause. SeeSqlJetConflictAction.- Specified by:
updateOrin interfaceISqlJetCursor- Parameters:
onConflict-SqlJetConflictAction.values- New record values.- Throws:
SqlJetException
-
updateByFieldNames
public void updateByFieldNames(java.util.Map<java.lang.String,java.lang.Object> values) throws SqlJetExceptionDescription copied from interface:ISqlJetCursorUpdates the current record.- Specified by:
updateByFieldNamesin interfaceISqlJetCursor- Parameters:
values- New record values mapped by field names.- Throws:
SqlJetException
-
updateByFieldNamesOr
public void updateByFieldNamesOr(SqlJetConflictAction onConflict, java.util.Map<java.lang.String,java.lang.Object> values) throws SqlJetException
Description copied from interface:ISqlJetCursorUpdates the current record. Implements ON CONFLICT clause. SeeSqlJetConflictAction.- Specified by:
updateByFieldNamesOrin interfaceISqlJetCursor- Parameters:
onConflict-SqlJetConflictAction.values- New record values mapped by field names.- Throws:
SqlJetException
-
updateWithRowId
public long updateWithRowId(long rowId, java.lang.Object... values) throws SqlJetExceptionDescription copied from interface:ISqlJetCursorUpdates rowId and values in the current record.- Specified by:
updateWithRowIdin interfaceISqlJetCursorvalues- New record values.- Throws:
SqlJetException
-
updateWithRowIdOr
public long updateWithRowIdOr(SqlJetConflictAction onConflict, long rowId, java.lang.Object... values) throws SqlJetException
Description copied from interface:ISqlJetCursorUpdates rowId and values in the current record. Implements ON CONFLICT clause. SeeSqlJetConflictAction.- Specified by:
updateWithRowIdOrin interfaceISqlJetCursor- Parameters:
onConflict-SqlJetConflictAction.values- New record values.- 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
-
getRowIndex
public long getRowIndex() throws SqlJetExceptionDescription copied from interface:ISqlJetCursorReturns index of the current row. Index is 1-based, first record has index of one.- Specified by:
getRowIndexin interfaceISqlJetCursor- Returns:
- 1-based index of the current row.
- Throws:
SqlJetException
-
getRowCount
public long getRowCount() throws SqlJetExceptionDescription copied from interface:ISqlJetCursorReturns number of rows accessible with this cursor.- Specified by:
getRowCountin interfaceISqlJetCursor- Returns:
- number of rows
- Throws:
SqlJetException
-
goToRow
public boolean goToRow(long rowIndex) throws SqlJetExceptionDescription copied from interface:ISqlJetCursorGoes to the row with the specified index. Index is 1-based, first record has index of one.- Specified by:
goToRowin interfaceISqlJetCursor- Returns:
- true if cursor has been set on the specified record.
- Throws:
SqlJetException
-
getLimit
public long getLimit()
Description copied from interface:ISqlJetCursorReturns limit of this cursor.- Specified by:
getLimitin interfaceISqlJetCursor- Returns:
- limit of this cursor or zero if limit has not been set.
-
setLimit
public void setLimit(long limit) throws SqlJetExceptionDescription copied from interface:ISqlJetCursorSets limit for this cursor. Negative or zero value resets limit to infinity.- Specified by:
setLimitin interfaceISqlJetCursor- Parameters:
limit- limit to set or zero to drop the limit.- Throws:
SqlJetException
-
getRowValues
public java.lang.Object[] getRowValues() throws SqlJetExceptionDescription copied from interface:ISqlJetCursorReturns all field values of current row.- Specified by:
getRowValuesin interfaceISqlJetCursor- Returns:
- field values array
- Throws:
SqlJetException
-
-