com.rapidminer.example.table
Class DatabaseExampleTable

java.lang.Object
  extended by com.rapidminer.example.table.AbstractExampleTable
      extended by com.rapidminer.example.table.DatabaseExampleTable
All Implemented Interfaces:
ExampleTable, java.io.Serializable

public class DatabaseExampleTable
extends AbstractExampleTable

This class is another data supplier for example sets. For performance reasons one should use a MemoryExampleTable if the data is small enough for the main memory. Additionally, directly working on databases is highly experimental and therefore usually not recommended.

Author:
Ingo Mierswa ingomierswa Exp $
See Also:
Serialized Form

Method Summary
 int addAttribute(Attribute attribute)
          Adds the attribute to the list of attributes assigning it a free column index.
static DatabaseExampleTable createDatabaseExampleTable(DatabaseHandler databaseHandler, java.lang.String tableName)
           
protected  void finalize()
           
 DataRow getDataRow(int index)
          Returns the data row with the desired row index.
 DataRowReader getDataRowReader()
          Returns an Iterator for example data given as DataRow objects.
 void removeAttribute(Attribute attribute)
          Equivalent to calling removeAttribute(attribute.getTableIndex()).
 int size()
          Returns the number of examples.
 
Methods inherited from class com.rapidminer.example.table.AbstractExampleTable
addAttributes, createExampleSet, createExampleSet, createExampleSet, createExampleSet, createExampleSet, createExampleSet, findAttribute, getAttribute, getAttributeCount, getAttributes, getNumberOfAttributes, removeAttribute, toDataString, toString
 
Methods inherited from class java.lang.Object
clone, equals, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Method Detail

createDatabaseExampleTable

public static DatabaseExampleTable createDatabaseExampleTable(DatabaseHandler databaseHandler,
                                                              java.lang.String tableName)
                                                       throws java.sql.SQLException
Throws:
java.sql.SQLException

getDataRowReader

public DataRowReader getDataRowReader()
Description copied from interface: ExampleTable
Returns an Iterator for example data given as DataRow objects. This should be used in all cases where iteration is desired. Since ExampleTable.getDataRow(int) does not ensure to work in an efficient way the usage of this method is preferred (instead using for-loops).


getDataRow

public DataRow getDataRow(int index)
Returns the data row with the desired row index.


addAttribute

public int addAttribute(Attribute attribute)
Description copied from class: AbstractExampleTable
Adds the attribute to the list of attributes assigning it a free column index. If the name is already in use, the attribute will be renamed.

Specified by:
addAttribute in interface ExampleTable
Overrides:
addAttribute in class AbstractExampleTable

removeAttribute

public void removeAttribute(Attribute attribute)
Description copied from class: AbstractExampleTable
Equivalent to calling removeAttribute(attribute.getTableIndex()).

Specified by:
removeAttribute in interface ExampleTable
Overrides:
removeAttribute in class AbstractExampleTable

size

public int size()
Description copied from interface: ExampleTable
Returns the number of examples.


finalize

protected void finalize()
Overrides:
finalize in class java.lang.Object


Copyright © 2001-2009 by Rapid-I