cmu.survey.data
Interface ForwardOnlyData

All Known Implementing Classes:
DataTableModelMySQL.ForwardOnlyDataSQL

public interface ForwardOnlyData

For those who want to implement a new ForwardOnlyData (probably in a new DataTableModel): Note that this automatically upgrades the table whenever something is accessed that doesn't currently exist, if a TableFormat has been set for the table. You can only get a new ForwardOnlyData with DataTableModel.getForwardOnlyData(). That upgrade will check TableVersionStorage to see if the table should actually be upgraded.


Method Summary
 void close()
          Call when done accessing this ForwardOnlyData.
 void deleteRecord()
          Deletes the current row -- this method can only be called after you call moveToNextRecord() and it returns true.
 java.lang.Object getData(int columnIndex)
          ColumnIndex starts at 0.
 java.lang.Object getData(java.lang.String columnName)
           
 java.util.Date getDateData(java.lang.String columnName)
           
 java.lang.Integer getIntegerData(java.lang.String columnName)
           
 java.lang.String getStringData(java.lang.String columnName)
           
 boolean isOpen()
          If the set is open
 boolean moveToNextRecord()
          Moves to the next record, and if it succeeds, returns true.
 void setData(java.lang.String columnName, java.lang.Object object)
           
 

Method Detail

isOpen

boolean isOpen()
If the set is open

Returns:

moveToNextRecord

boolean moveToNextRecord()
                         throws FailedRequest.AlreadyClosedError
Moves to the next record, and if it succeeds, returns true. Returns false if (a) there are no more records, or if (b) it can't go on to the next record due to a database error

Returns:
whether going on to the next record succeeded
Throws:
FailedRequest.AlreadyClosedError - if the ForwardOnlyData has already been closed manually

getData

java.lang.Object getData(int columnIndex)
                         throws FailedRequest
ColumnIndex starts at 0.

Parameters:
columnIndex - starting at 0.
Returns:
Throws:
FailedRequest

getData

java.lang.Object getData(java.lang.String columnName)
                         throws FailedRequest
Throws:
FailedRequest

getStringData

java.lang.String getStringData(java.lang.String columnName)
                               throws FailedRequest
Throws:
FailedRequest

getIntegerData

java.lang.Integer getIntegerData(java.lang.String columnName)
                                 throws FailedRequest
Throws:
FailedRequest

getDateData

java.util.Date getDateData(java.lang.String columnName)
                           throws FailedRequest
Throws:
FailedRequest

setData

void setData(java.lang.String columnName,
             java.lang.Object object)
             throws FailedRequest
Throws:
FailedRequest

deleteRecord

void deleteRecord()
                  throws FailedRequest
Deletes the current row -- this method can only be called after you call moveToNextRecord() and it returns true. This does NOT move to the next record -- until you call "moveToNextRecord()" again, you cannot call any getData() methods.

Throws:
FailedRequest

close

void close()
Call when done accessing this ForwardOnlyData.