com.rapidminer.datatable
Class AbstractDataTable

java.lang.Object
  extended by com.rapidminer.datatable.AbstractDataTable
All Implemented Interfaces:
DataTable, Reportable, Tableable, java.lang.Iterable<DataTableRow>
Direct Known Subclasses:
DataTableExampleSetAdapter, DataTableKernelModelAdapter, DataTablePairwiseMatrixExtractionAdapter, DataTableSymmetricalMatrixAdapter, FilteredDataTable, LocalPolynomialRegressionModelTableRenderer.LocalPolynomialRegressionModelDataTable, SimpleDataTable

public abstract class AbstractDataTable
extends java.lang.Object
implements DataTable, Tableable

This abstract data table implementation provides some default implementations for data tables like listener handling. The method fireEvent() can be used to promote changes to all listeners. In addition, IO methods are also provided by this abstract implementation.

Author:
Ingo Mierswa

Constructor Summary
AbstractDataTable()
          This is a constructor that will not set any name.
AbstractDataTable(java.lang.String name)
           
 
Method Summary
 void addDataTableListener(DataTableListener dataTableListener)
          Adds a table listener listening for data changes.
 boolean containsMissingValues()
          Returns true if this data table contains missing values.
 void finishReporting()
           
protected  void fireEvent()
           
 java.lang.String getCell(int row, int column)
           
 java.lang.String[] getColumnNames()
          Returns an array of all column names.
 int getColumnNumber()
           
 java.lang.String getName()
          Returns the name of this data table.
 int getRowNumber()
           
 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 isDeselected(java.lang.String id)
           
 boolean isFirstColumnHeader()
           
 boolean isFirstLineHeader()
           
 void prepareReporting()
           
 void removeDataTableListener(DataTableListener dataTableListener)
          Removes the given listener from the list of data change listeners.
 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 class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface com.rapidminer.datatable.DataTable
add, getColumnIndex, getColumnName, getColumnWeight, getNumberOfColumns, getNumberOfRows, getNumberOfSpecialColumns, getNumberOfValues, getRow, isDate, isDateTime, isNominal, isNumerical, isSpecial, isSupportingColumnWeights, isTime, iterator, mapIndex, mapString, sample
 

Constructor Detail

AbstractDataTable

public AbstractDataTable()
This is a constructor that will not set any name. It is used for serialization of subclasses.


AbstractDataTable

public AbstractDataTable(java.lang.String name)
Method Detail

getName

public java.lang.String getName()
Description copied from interface: DataTable
Returns the name of this data table.

Specified by:
getName in interface DataTable

setName

public void setName(java.lang.String name)
Description copied from interface: DataTable
Sets the name of the data table.

Specified by:
setName in interface DataTable

getColumnNames

public java.lang.String[] getColumnNames()
Description copied from interface: DataTable
Returns an array of all column names.

Specified by:
getColumnNames in interface DataTable

addDataTableListener

public void addDataTableListener(DataTableListener dataTableListener)
Description copied from interface: DataTable
Adds a table listener listening for data changes.

Specified by:
addDataTableListener in interface DataTable

removeDataTableListener

public void removeDataTableListener(DataTableListener dataTableListener)
Description copied from interface: DataTable
Removes the given listener from the list of data change listeners.

Specified by:
removeDataTableListener in interface DataTable

fireEvent

protected void fireEvent()

getValueAsString

public java.lang.String getValueAsString(DataTableRow row,
                                         int column)
Description copied from interface: DataTable
Must deliver the proper value as string, i.e. the mapped value for nominal columns.

Specified by:
getValueAsString in interface DataTable

write

public void write(java.io.PrintWriter out)
           throws java.io.IOException
Description copied from interface: DataTable
Writes the table into the given writer.

Specified by:
write in interface DataTable
Throws:
java.io.IOException

containsMissingValues

public boolean containsMissingValues()
Description copied from interface: DataTable
Returns true if this data table contains missing values.

Specified by:
containsMissingValues in interface DataTable

getRowNumber

public int getRowNumber()
Specified by:
getRowNumber in interface Tableable

getColumnNumber

public int getColumnNumber()
Specified by:
getColumnNumber in interface Tableable

getCell

public java.lang.String getCell(int row,
                                int column)
Specified by:
getCell in interface Tableable

prepareReporting

public void prepareReporting()
Specified by:
prepareReporting in interface Tableable

finishReporting

public void finishReporting()
Specified by:
finishReporting in interface Tableable

isFirstLineHeader

public boolean isFirstLineHeader()
Specified by:
isFirstLineHeader in interface Tableable

isFirstColumnHeader

public boolean isFirstColumnHeader()
Specified by:
isFirstColumnHeader in interface Tableable

isDeselected

public boolean isDeselected(java.lang.String id)
Specified by:
isDeselected in interface DataTable

setSelection

public void setSelection(AbstractChartPanel.Selection selection)
Specified by:
setSelection in interface DataTable

getSelectionCount

public int getSelectionCount()
Specified by:
getSelectionCount in interface DataTable


Copyright © 2001-2009 by Rapid-I