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 StringdataRowTypeTipText()Returns the tip text for this property.SpreadSheetWritergetCorrespondingWriter()Returns, if available, the corresponding writer.DataRowgetDataRowType()Returns the type of data row to use.StringgetDefaultFormatExtension()Returns the default extension of the format.StringgetFormatDescription()Returns a string describing the format (used in the file chooser).String[]getFormatExtensions()Returns the extension(s) of the format.StringgetLastError()Returns the error that occurred during the last read.SpreadSheetgetSpreadSheetType()Returns the type of spreadsheet to use.booleanhasLastError()Returns whether an error was encountered during the last read.booleanisStopped()Returns whether the reading was stopped.SpreadSheetread(File file)Reads the spreadsheet from the specified file.SpreadSheetread(InputStream stream)Reads the spreadsheet from the stream.SpreadSheetread(Reader r)Reads the spreadsheet from the given reader.SpreadSheetread(String filename)Reads the spreadsheet from the given file.voidsetDataRowType(DataRow value)Sets the type of data row to use.voidsetSpreadSheetType(SpreadSheet value)Sets the type of spreadsheet to use.StringspreadSheetTypeTipText()Returns the tip text for this property.voidstopExecution()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:
getFormatDescriptionin interfaceFileFormatHandler- Returns:
- a description suitable for displaying in the file chooser
-
getFormatExtensions
String[] getFormatExtensions()
Returns the extension(s) of the format.- Specified by:
getFormatExtensionsin interfaceFileFormatHandler- Returns:
- the extension (without the dot!)
-
getDefaultFormatExtension
String getDefaultFormatExtension()
Returns the default extension of the format.- Specified by:
getDefaultFormatExtensionin 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:
stopExecutionin interfaceStoppable
-
isStopped
boolean isStopped()
Returns whether the reading was stopped.- Specified by:
isStoppedin interfaceStoppableWithFeedback- Returns:
- true if stopped
-
hasLastError
boolean hasLastError()
Returns whether an error was encountered during the last read.- Specified by:
hasLastErrorin interfaceErrorProvider- Returns:
- true if an error occurred
-
getLastError
String getLastError()
Returns the error that occurred during the last read.- Specified by:
getLastErrorin interfaceErrorProvider- Returns:
- the error string, null if none occurred
-
-