litebase
Class RowIterator

java.lang.Object
  |
  +--litebase.RowIterator

public class RowIterator
extends java.lang.Object

Class used to iterate through the rows of a database. It can access some attributes from the row that easy the control of which row was changed, deleted or is newer since a synchronization.


Field Summary
 byte attr
          The attribute for this row.
 byte[] data
          The data for the current row.
static byte ROW_ATTR_DELETED
           
static byte ROW_ATTR_NEW
           
static byte ROW_ATTR_SYNCED
           
static byte ROW_ATTR_UPDATED
           
 int rowid
          The rowid for the current row
 int rowNumber
          The number of the row.
 
Method Summary
 void close()
          Closes this iterator.
 boolean next()
          Moves to the next record and fills the data members.
 boolean nextNotSynced()
          Moves to the next with an attribute different of SYNCED.
 void reset()
          Reset the counter to zero so you can restart to fetch records.
 void setSynced()
          If the attribute is currently NEW or UPDATED, this method sets them to SYNCED.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

ROW_ATTR_SYNCED

public static final byte ROW_ATTR_SYNCED

ROW_ATTR_NEW

public static final byte ROW_ATTR_NEW

ROW_ATTR_UPDATED

public static final byte ROW_ATTR_UPDATED

ROW_ATTR_DELETED

public static final byte ROW_ATTR_DELETED

data

public byte[] data
The data for the current row. The whole row is included.

rowid

public int rowid
The rowid for the current row

attr

public byte attr
The attribute for this row. You must use the constants ROW_ATTR_ to compare or assign.

rowNumber

public int rowNumber
The number of the row. Note: this must be READ_ONLY. Changing it will corrupt your database.
Method Detail

next

public boolean next()
Moves to the next record and fills the data members.

nextNotSynced

public boolean nextNotSynced()
Moves to the next with an attribute different of SYNCED.

setSynced

public void setSynced()
If the attribute is currently NEW or UPDATED, this method sets them to SYNCED. Note that if the row is DELETED, the change will be ignored.

close

public void close()
Closes this iterator.

reset

public void reset()
Reset the counter to zero so you can restart to fetch records.