com.rapidminer.datatable
Interface DataTable

All Superinterfaces:
java.lang.Iterable<DataTableRow>, Reportable, Tableable
All Known Implementing Classes:
AbstractDataTable, DataTableExampleSetAdapter, DataTableKernelModelAdapter, DataTablePairwiseMatrixExtractionAdapter, DataTableSymmetricalMatrixAdapter, FilteredDataTable, LocalPolynomialRegressionModelTableRenderer.LocalPolynomialRegressionModelDataTable, SimpleDataTable

public interface DataTable
extends java.lang.Iterable<DataTableRow>, Tableable

A data table that contains Object arrays that record process results, data, etc. Instances of this class are automatically created by Process.getDataTables() and are used mainly by the ProcessLogOperator. On the other hand, also ExampleSets can also be used as an data table object.

Author:
Ingo Mierswa

Method Summary
 void add(DataTableRow row)
          Adds the given DataTableRow to the table.
 void addDataTableListener(DataTableListener dataTableListener)
          Adds a table listener listening for data changes.
 boolean containsMissingValues()
          Returns true if this data table contains missing values.
 int getColumnIndex(java.lang.String name)
          Returns the column index of the column with the given name.
 java.lang.String getColumnName(int i)
          Returns the name of the i-th column.
 java.lang.String[] getColumnNames()
          Returns an array of all column names.
 double getColumnWeight(int i)
          Returns the weight of the column or Double.NaN if no weight is available.
 java.lang.String getName()
          Returns the name of this data table.
 int getNumberOfColumns()
          Returns the total number of columns.
 int getNumberOfRows()
          Returns the total number of rows.
 int getNumberOfSpecialColumns()
          Returns the total number of special columns.
 int getNumberOfValues(int column)
          Returns the number of different values for the i-th column.
 DataTableRow getRow(int index)
          Returns the data table row with the given index.
 int getSelectionCount()
           
 java.lang.String getValueAsString(DataTableRow row, int column)
          Must deliver the proper value as string, i.e. the mapped value for nominal columns.
 boolean isDate(int index)
          Indicates if the column with the given index is nominal.
 boolean isDateTime(int index)
          Indicates if the column with the given index is nominal.
 boolean isDeselected(java.lang.String id)
           
 boolean isNominal(int index)
          Indicates if the column with the given index is nominal.
 boolean isNumerical(int index)
          Indicates if the column with the given index is nominal.
 boolean isSpecial(int column)
          Returns true if this column is a special column which might usually not be used for some plotters, for example weights or labels.
 boolean isSupportingColumnWeights()
          Returns true if this data table is supporting column weights.
 boolean isTime(int index)
          Indicates if the column with the given index is nominal.
 java.util.Iterator<DataTableRow> iterator()
          Returns an iterator over all DataTableRows.
 java.lang.String mapIndex(int column, int index)
          If a column is nominal, the index value must be mapped to the nominal value by this method.
 int mapString(int column, java.lang.String value)
          If a column is nominal, the nominal value must be mapped to a (new) index by this method.
 void removeDataTableListener(DataTableListener dataTableListener)
          Removes the given listener from the list of data change listeners.
 DataTable sample(int newSize)
          Performs a sampling of this data table.
 void setName(java.lang.String name)
          Sets the name of the data table.
 void setSelection(AbstractChartPanel.Selection selection)
           
 void write(java.io.PrintWriter out)
          Writes the table into the given writer.
 
Methods inherited from interface com.rapidminer.report.Tableable
finishReporting, getCell, getColumnNumber, getRowNumber, isFirstColumnHeader, isFirstLineHeader, prepareReporting
 

Method Detail

isNominal

boolean isNominal(int index)
Indicates if the column with the given index is nominal. For numerical or date columns, the value false should be returned.


isTime

boolean isTime(int index)
Indicates if the column with the given index is nominal. For numerical or date columns, the value false should be returned.


isDate

boolean isDate(int index)
Indicates if the column with the given index is nominal. For numerical or date columns, the value false should be returned.


isDateTime

boolean isDateTime(int index)
Indicates if the column with the given index is nominal. For numerical or date columns, the value false should be returned.


isNumerical

boolean isNumerical(int index)
Indicates if the column with the given index is nominal. For numerical or date columns, the value false should be returned.


mapIndex

java.lang.String mapIndex(int column,
                          int index)
If a column is nominal, the index value must be mapped to the nominal value by this method. If the given column is not nominal, this method might throw a NullPointerException.


mapString

int mapString(int column,
              java.lang.String value)
If a column is nominal, the nominal value must be mapped to a (new) index by this method. If the given column is not nominal, this method might throw a NullPointerException.


getColumnName

java.lang.String getColumnName(int i)
Returns the name of the i-th column.

Specified by:
getColumnName in interface Tableable

getColumnIndex

int getColumnIndex(java.lang.String name)
Returns the column index of the column with the given name.


getColumnWeight

double getColumnWeight(int i)
Returns the weight of the column or Double.NaN if no weight is available.


isSupportingColumnWeights

boolean isSupportingColumnWeights()
Returns true if this data table is supporting column weights.


getNumberOfColumns

int getNumberOfColumns()
Returns the total number of columns.


getNumberOfSpecialColumns

int getNumberOfSpecialColumns()
Returns the total number of special columns. Please note that these columns do not need to be in an ordered sequence. In order to make sure that a column is a special column the method isSpecial(int) should be used.


isSpecial

boolean isSpecial(int column)
Returns true if this column is a special column which might usually not be used for some plotters, for example weights or labels.


getColumnNames

java.lang.String[] getColumnNames()
Returns an array of all column names.


getName

java.lang.String getName()
Returns the name of this data table.


setName

void setName(java.lang.String name)
Sets the name of the data table.


add

void add(DataTableRow row)
Adds the given DataTableRow to the table.


iterator

java.util.Iterator<DataTableRow> iterator()
Returns an iterator over all DataTableRows.

Specified by:
iterator in interface java.lang.Iterable<DataTableRow>

getRow

DataTableRow getRow(int index)
Returns the data table row with the given index. Please note that this method is not guaranteed to be efficiently implemented. If you want to scan the complete data table you should use the iterator() method instead.


getNumberOfRows

int getNumberOfRows()
Returns the total number of rows.


getNumberOfValues

int getNumberOfValues(int column)
Returns the number of different values for the i-th column. Might return -1 or throw an exception if the specific column is not nominal.


getValueAsString

java.lang.String getValueAsString(DataTableRow row,
                                  int column)
Must deliver the proper value as string, i.e. the mapped value for nominal columns.


addDataTableListener

void addDataTableListener(DataTableListener dataTableListener)
Adds a table listener listening for data changes.


removeDataTableListener

void removeDataTableListener(DataTableListener dataTableListener)
Removes the given listener from the list of data change listeners.


write

void write(java.io.PrintWriter out)
           throws java.io.IOException
Writes the table into the given writer.

Throws:
java.io.IOException

sample

DataTable sample(int newSize)
Performs a sampling of this data table. Following operations should only work on the sample.


containsMissingValues

boolean containsMissingValues()
Returns true if this data table contains missing values.


isDeselected

boolean isDeselected(java.lang.String id)

setSelection

void setSelection(AbstractChartPanel.Selection selection)

getSelectionCount

int getSelectionCount()


Copyright © 2001-2009 by Rapid-I