jfreerails.world.top
Interface WorldIterator

All Known Implementing Classes:
NonNullElements

public interface WorldIterator

This interface lets the caller access the results of a search in the gameworld. It is similar in concept to java.sql.ResultSet.

Author:
Luke

Field Summary
static int BEFORE_FIRST
           
 
Method Summary
 FreerailsSerializable getElement()
          Returns the element the curor is pointing to.
 int getIndex()
          Returns the index of the element the cursor is pointing to.
 int getNaturalNumber()
          Returns the number of the row where the cursor is (the first row is 1).
 int getRowID()
          Returns the number of the row where the cursor is (the first row is 0).
 void gotoIndex(int i)
          Moves the cursor to the specified index.
 void gotoRow(int row)
          Moves the cursor to the specified index.
 boolean next()
          Moves the cursor down one row from its current position.
 boolean previous()
          Moves the cursor up one row from its current position.
 void reset()
          Moves the cursor to before the first element and updates any cached values.
 int size()
          Returns the number of rows.
 

Field Detail

BEFORE_FIRST

static final int BEFORE_FIRST
See Also:
Constant Field Values
Method Detail

next

boolean next()
Moves the cursor down one row from its current position.


previous

boolean previous()
Moves the cursor up one row from its current position.


reset

void reset()
Moves the cursor to before the first element and updates any cached values.


getElement

FreerailsSerializable getElement()
Returns the element the curor is pointing to.


getIndex

int getIndex()
Returns the index of the element the cursor is pointing to. The value returned is index you would need to use in World.get(KEY key, int index) to retrieve the same element as is returned by getElement()


getRowID

int getRowID()
Returns the number of the row where the cursor is (the first row is 0).


size

int size()
Returns the number of rows.


gotoIndex

void gotoIndex(int i)
Moves the cursor to the specified index.


gotoRow

void gotoRow(int row)
Moves the cursor to the specified index.


getNaturalNumber

int getNaturalNumber()
Returns the number of the row where the cursor is (the first row is 1).