org.knime.base.node.io.arffreader
Class ARFFTable

java.lang.Object
  extended by org.knime.base.node.io.arffreader.ARFFTable
All Implemented Interfaces:
Iterable<DataRow>, DataTable

public class ARFFTable
extends Object
implements DataTable

Author:
Peter Ohl, University of Konstanz

Constructor Summary
ARFFTable(URL arffFileLocation, DataTableSpec tSpec, String rowKeyPrefix)
          Create a new DataTable reading its content from an ARFF file at the specified location.
 
Method Summary
static DataTableSpec createDataTableSpecFromARFFfile(URL fileLoc, ExecutionMonitor exec)
          Reads in the header of the specified ARFF file and returns a corresponding table spec object.
 DataTableSpec getDataTableSpec()
          Returns the DataTableSpec object of this table which gives information about the structure of this data table.
 RowIterator iterator()
          Returns a row iterator which returns each row one-by-one from the table.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ARFFTable

public ARFFTable(URL arffFileLocation,
                 DataTableSpec tSpec,
                 String rowKeyPrefix)
Create a new DataTable reading its content from an ARFF file at the specified location.

Parameters:
arffFileLocation - valid URL which points to the ARFF file to read
tSpec - the structure of the table to create
rowKeyPrefix - row keys are constructed like rowKeyPrefix + lineNo
Method Detail

getDataTableSpec

public DataTableSpec getDataTableSpec()
Returns the DataTableSpec object of this table which gives information about the structure of this data table.

Specified by:
getDataTableSpec in interface DataTable
Returns:
the DataTableSpec of this table

iterator

public RowIterator iterator()
Returns a row iterator which returns each row one-by-one from the table.

Specified by:
iterator in interface Iterable<DataRow>
Specified by:
iterator in interface DataTable
Returns:
row iterator
See Also:
DataRow

createDataTableSpecFromARFFfile

public static DataTableSpec createDataTableSpecFromARFFfile(URL fileLoc,
                                                            ExecutionMonitor exec)
                                                     throws IOException,
                                                            InvalidSettingsException,
                                                            CanceledExecutionException
Reads in the header of the specified ARFF file and returns a corresponding table spec object.

Parameters:
fileLoc - the location of the ARFF file to read
exec - to enable users to cancel this process
Returns:
a table spec reflecting the settings in the file header
Throws:
IOException - if the file location couldn't be opened
InvalidSettingsException - if the file contains an invalid format
CanceledExecutionException - if user canceled


Copyright, 2003 - 2010. All rights reserved.
University of Konstanz, Germany.
Chair for Bioinformatics and Information Mining, Prof. Dr. Michael R. Berthold.
You may not modify, publish, transmit, transfer or sell, reproduce, create derivative works from, distribute, perform, display, or in any way exploit any of the content, in whole or in part, except as otherwise expressly permitted in writing by the copyright owner or as specified in the license file distributed with this product.