com.rapidminer.example.table
Class DatabaseDataRow

java.lang.Object
  extended by com.rapidminer.example.table.DataRow
      extended by com.rapidminer.example.table.DatabaseDataRow
All Implemented Interfaces:
java.io.Serializable

public class DatabaseDataRow
extends DataRow

Reads datarows from a data base.

Author:
Ingo Mierswa, Simon Fischer
See Also:
Serialized Form

Constructor Summary
DatabaseDataRow(java.sql.ResultSet resultSet)
          Creates a data row from the given result set.
 
Method Summary
protected  void ensureNumberOfColumns(int numberOfColumns)
          Does nothing.
 double get(Attribute attribute)
          Returns the desired data for the given attribute.
protected  double get(int index, double defaultValue)
          Returns the value for the given index.
static double readColumn(java.sql.ResultSet resultSet, Attribute attribute)
          Reads the data for the given attribute from the result set.
 void set(Attribute attribute, double value)
          Sets the given data for the given attribute.
protected  void set(int index, double value, double defaultValue)
          Sets the given data for the given index.
 java.lang.String toString()
          Returns a string representation for this data row.
 void trim()
          Does nothing.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

DatabaseDataRow

public DatabaseDataRow(java.sql.ResultSet resultSet)
                throws java.sql.SQLException
Creates a data row from the given result set. The current row of the result set if used as data source.

Throws:
java.sql.SQLException
Method Detail

get

public double get(Attribute attribute)
Returns the desired data for the given attribute.

Overrides:
get in class DataRow

set

public void set(Attribute attribute,
                double value)
Sets the given data for the given attribute.

Overrides:
set in class DataRow

get

protected double get(int index,
                     double defaultValue)
Description copied from class: DataRow
Returns the value for the given index.

Specified by:
get in class DataRow

set

protected void set(int index,
                   double value,
                   double defaultValue)
Description copied from class: DataRow
Sets the given data for the given index.

Specified by:
set in class DataRow

ensureNumberOfColumns

protected void ensureNumberOfColumns(int numberOfColumns)
Does nothing.

Specified by:
ensureNumberOfColumns in class DataRow

trim

public void trim()
Does nothing.

Specified by:
trim in class DataRow

toString

public java.lang.String toString()
Description copied from class: DataRow
Returns a string representation for this data row.

Specified by:
toString in class DataRow

readColumn

public static double readColumn(java.sql.ResultSet resultSet,
                                Attribute attribute)
                         throws java.sql.SQLException
Reads the data for the given attribute from the result set.

Throws:
java.sql.SQLException


Copyright © 2001-2009 by Rapid-I