Package adams.data.io.input
Interface SpreadSheetReader
-
- All Superinterfaces:
Destroyable
,ErrorProvider
,FileFormatHandler
,OptionHandler
,Serializable
,Stoppable
,StoppableWithFeedback
- All Known Subinterfaces:
ChunkedSpreadSheetReader
,InitialRowSkippingSpreadSheetReader
,MissingValueSpreadSheetReader
,MultiSheetSpreadSheetReader<T>
,NoHeaderSpreadSheetReader
,WindowedSpreadSheetReader
- All Known Implementing Classes:
AbstractExcelSpreadSheetReader
,AbstractMultiSheetSpreadSheetReader
,AbstractMultiSheetSpreadSheetReaderWithMissingValueSupport
,AbstractSpreadSheetReader
,AbstractSpreadSheetReaderWithMissingValueSupport
,AbstractWekaSpreadSheetReader
,AccessSpreadSheetReader
,ArffSpreadSheetReader
,AutoWidthTabularSpreadSheetReader
,CsvSpreadSheetReader
,ExcelSpreadSheetReader
,ExcelStreamingSpreadSheetReader
,FastCsvSpreadSheetReader
,FixedTabularSpreadSheetReader
,GnumericSpreadSheetReader
,JSONSpreadSheetReader
,LibSVMSpreadSheetReader
,Mat5SpreadSheetReader
,MatlabSpreadSheetReader
,ODFSpreadSheetReader
,PNGSpreadSheetReader
,PropertiesSpreadSheetReader
,SimpleArffSpreadSheetReader
,SimpleCsvSpreadSheetReader
,SimpleStreamSpreadSheetReader
,SqlDumpSpreadSheetReader
,SVMLightSpreadSheetReader
,TsvSpreadSheetReader
,XrffSpreadSheetReader
public interface SpreadSheetReader extends Serializable, StoppableWithFeedback, OptionHandler, FileFormatHandler, ErrorProvider
Interface for spreadsheet readers.- Version:
- $Revision$
- Author:
- fracpete (fracpete at waikato dot ac dot nz)
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description String
dataRowTypeTipText()
Returns the tip text for this property.SpreadSheetWriter
getCorrespondingWriter()
Returns, if available, the corresponding writer.DataRow
getDataRowType()
Returns the type of data row to use.String
getDefaultFormatExtension()
Returns the default extension of the format.String
getFormatDescription()
Returns a string describing the format (used in the file chooser).String[]
getFormatExtensions()
Returns the extension(s) of the format.String
getLastError()
Returns the error that occurred during the last read.SpreadSheet
getSpreadSheetType()
Returns the type of spreadsheet to use.boolean
hasLastError()
Returns whether an error was encountered during the last read.boolean
isStopped()
Returns whether the reading was stopped.SpreadSheet
read(File file)
Reads the spreadsheet from the specified file.SpreadSheet
read(InputStream stream)
Reads the spreadsheet from the stream.SpreadSheet
read(Reader r)
Reads the spreadsheet from the given reader.SpreadSheet
read(String filename)
Reads the spreadsheet from the given file.void
setDataRowType(DataRow value)
Sets the type of data row to use.void
setSpreadSheetType(SpreadSheet value)
Sets the type of spreadsheet to use.String
spreadSheetTypeTipText()
Returns the tip text for this property.void
stopExecution()
Stops the reading (might not be immediate, depending on reader).-
Methods inherited from interface adams.core.Destroyable
destroy
-
Methods inherited from interface adams.core.option.OptionHandler
cleanUpOptions, defineOptions, getOptionManager, toCommandLine
-
-
-
-
Method Detail
-
getFormatDescription
String getFormatDescription()
Returns a string describing the format (used in the file chooser).- Specified by:
getFormatDescription
in interfaceFileFormatHandler
- Returns:
- a description suitable for displaying in the file chooser
-
getFormatExtensions
String[] getFormatExtensions()
Returns the extension(s) of the format.- Specified by:
getFormatExtensions
in interfaceFileFormatHandler
- Returns:
- the extension (without the dot!)
-
getDefaultFormatExtension
String getDefaultFormatExtension()
Returns the default extension of the format.- Specified by:
getDefaultFormatExtension
in interfaceFileFormatHandler
- Returns:
- the default extension (without the dot!)
-
getCorrespondingWriter
SpreadSheetWriter getCorrespondingWriter()
Returns, if available, the corresponding writer.- Returns:
- the writer, null if none available
-
setDataRowType
void setDataRowType(DataRow value)
Sets the type of data row to use.- Parameters:
value
- the type
-
getDataRowType
DataRow getDataRowType()
Returns the type of data row to use.- Returns:
- the type
-
dataRowTypeTipText
String dataRowTypeTipText()
Returns the tip text for this property.- Returns:
- tip text for this property suitable for displaying in the GUI or for listing the options.
-
setSpreadSheetType
void setSpreadSheetType(SpreadSheet value)
Sets the type of spreadsheet to use.- Parameters:
value
- the type
-
getSpreadSheetType
SpreadSheet getSpreadSheetType()
Returns the type of spreadsheet to use.- Returns:
- the type
-
spreadSheetTypeTipText
String spreadSheetTypeTipText()
Returns the tip text for this property.- Returns:
- tip text for this property suitable for displaying in the GUI or for listing the options.
-
read
SpreadSheet read(File file)
Reads the spreadsheet from the specified file.- Parameters:
file
- the file to read from- Returns:
- null in case of an error, otherwise the spreadsheet
-
read
SpreadSheet read(String filename)
Reads the spreadsheet from the given file.- Parameters:
filename
- the file to read from- Returns:
- the spreadsheet or null in case of an error
-
read
SpreadSheet read(InputStream stream)
Reads the spreadsheet from the stream. The caller must ensure to close the stream.- Parameters:
stream
- the stream to read from- Returns:
- the spreadsheet or null in case of an error
-
read
SpreadSheet read(Reader r)
Reads the spreadsheet from the given reader. The caller must ensure to close the reader.- Parameters:
r
- the reader to read from- Returns:
- the spreadsheet or null in case of an error
-
stopExecution
void stopExecution()
Stops the reading (might not be immediate, depending on reader).- Specified by:
stopExecution
in interfaceStoppable
-
isStopped
boolean isStopped()
Returns whether the reading was stopped.- Specified by:
isStopped
in interfaceStoppableWithFeedback
- Returns:
- true if stopped
-
hasLastError
boolean hasLastError()
Returns whether an error was encountered during the last read.- Specified by:
hasLastError
in interfaceErrorProvider
- Returns:
- true if an error occurred
-
getLastError
String getLastError()
Returns the error that occurred during the last read.- Specified by:
getLastError
in interfaceErrorProvider
- Returns:
- the error string, null if none occurred
-
-