com.pushtotest.tool.datasource
Interface Datasource

All Known Implementing Classes:
Csv, Db, Tsv, Xsv

public interface Datasource

This is the interface to Datasources which are places you go to get information like Databases and flat files.


Method Summary
 int columnCount()
          Returns the number of columns in the current row.
 boolean getBoolean(int column)
          Returns the boolean value of the contents at the position of column.
 boolean getBoolean(java.lang.String name)
          Returns the boolean value found in the column of the given name.
 double getDouble(int column)
          Returns the double value of the contents at the position of column.
 double getDouble(java.lang.String name)
          Returns the double value found in the column of the given name.
 float getFloat(int column)
          Returns the float value of the contents at the position of column.
 float getFloat(java.lang.String name)
          Returns the float value found in the column of the given name.
 int getInt(int column)
          Returns the int value of the contents at the position of column.
 int getInt(java.lang.String name)
          Returns the int value found in the column of the given name.
 long getLong(int column)
          Returns the long value of the contents at the position of column.
 long getLong(java.lang.String name)
          Returns the long value found in the column of the given name.
 java.lang.String getString(int column)
          Returns the string value of the contents at the position of column.
 java.lang.String getString(java.lang.String name)
          Returns the string value found in the column of the given name.
 boolean isAfterLast()
          Tells whether the cursor has moved past the last row or not.
 boolean isBeforeFirst()
          Tells whether the cursor position is before the first line.
 boolean isFirst()
          Tells whether the cursor is on the first row or not.
 boolean isLast()
          Tells whether the cursor is on the last row or not.
 boolean next()
          Moves the cursor to the next line.
 

Method Detail

next

boolean next()
Moves the cursor to the next line. This must be called before the any of the get methods are called to move it to the first line.

Returns:
Whether there is a line to process.

isBeforeFirst

boolean isBeforeFirst()
Tells whether the cursor position is before the first line.

Returns:
If the cursor is beofore the first line.

isFirst

boolean isFirst()
Tells whether the cursor is on the first row or not.

Returns:
Is the cursor on the first row.

isAfterLast

boolean isAfterLast()
Tells whether the cursor has moved past the last row or not.

Returns:
Is the cursor past the last row?

isLast

boolean isLast()
Tells whether the cursor is on the last row or not.

Returns:
Is the cursor on the last row.

getString

java.lang.String getString(int column)
                           throws DatasourceException
Returns the string value of the contents at the position of column.

Parameters:
column - The position of the column in the row.
Returns:
The string stored at that position.
Throws:
DatasourceException - If something goes wrong.

getString

java.lang.String getString(java.lang.String name)
                           throws DatasourceException
Returns the string value found in the column of the given name.

Parameters:
name - The name of the column in the row.
Returns:
The string stored at that posisition.
Throws:
DatasourceException - If something goes wrong.

getLong

long getLong(int column)
             throws DatasourceException
Returns the long value of the contents at the position of column.

Parameters:
column - The position of the column in the row.
Returns:
The long value stored at that position.
Throws:
DatasourceException - If something goes wrong.

getLong

long getLong(java.lang.String name)
             throws DatasourceException
Returns the long value found in the column of the given name.

Parameters:
name - The name of the column in the row.
Returns:
The long value stored at that posisition.
Throws:
DatasourceException - If something goes wrong.

getInt

int getInt(int column)
           throws DatasourceException
Returns the int value of the contents at the position of column.

Parameters:
column - The position of the column in the row.
Returns:
The int value stored at that position.
Throws:
DatasourceException - If something goes wrong.

getInt

int getInt(java.lang.String name)
           throws DatasourceException
Returns the int value found in the column of the given name.

Parameters:
name - The name of the column in the row.
Returns:
The int value stored at that posisition.
Throws:
DatasourceException - If something goes wrong.

getDouble

double getDouble(int column)
                 throws DatasourceException
Returns the double value of the contents at the position of column.

Parameters:
column - The position of the column in the row.
Returns:
The double value stored at that position.
Throws:
DatasourceException - If something goes wrong.

getDouble

double getDouble(java.lang.String name)
                 throws DatasourceException
Returns the double value found in the column of the given name.

Parameters:
name - The name of the column in the row.
Returns:
The double value stored at that posisition.
Throws:
DatasourceException - If something goes wrong.

getFloat

float getFloat(int column)
               throws DatasourceException
Returns the float value of the contents at the position of column.

Parameters:
column - The position of the column in the row.
Returns:
The float value stored at that position.
Throws:
DatasourceException - If something goes wrong.

getFloat

float getFloat(java.lang.String name)
               throws DatasourceException
Returns the float value found in the column of the given name.

Parameters:
name - The name of the column in the row.
Returns:
The float value stored at that posisition.
Throws:
DatasourceException - If something goes wrong.

getBoolean

boolean getBoolean(int column)
                   throws DatasourceException
Returns the boolean value of the contents at the position of column.

Parameters:
column - The position of the column in the row.
Returns:
The boolean value stored at that position.
Throws:
DatasourceException - If something goes wrong.

getBoolean

boolean getBoolean(java.lang.String name)
                   throws DatasourceException
Returns the boolean value found in the column of the given name.

Parameters:
name - The name of the column in the row.
Returns:
The boolean value stored at that posisition.
Throws:
DatasourceException - If something goes wrong.

columnCount

int columnCount()
                throws DatasourceException
Returns the number of columns in the current row.

Throws:
DatasourceException - If called on an invalid row.