Package adams.data.io.input
Class AbstractExcelSpreadSheetReader<T extends Range>
- java.lang.Object
-
- adams.core.logging.LoggingObject
-
- adams.core.logging.CustomLoggingLevelObject
-
- adams.core.option.AbstractOptionHandler
-
- adams.data.io.input.AbstractSpreadSheetReader
-
- adams.data.io.input.AbstractMultiSheetSpreadSheetReader<T>
-
- adams.data.io.input.AbstractMultiSheetSpreadSheetReaderWithMissingValueSupport<T>
-
- adams.data.io.input.AbstractExcelSpreadSheetReader<T>
-
- All Implemented Interfaces:
AdditionalInformationHandler
,Destroyable
,ErrorProvider
,GlobalInfoSupporter
,EncodingSupporter
,FileFormatHandler
,LoggingLevelHandler
,LoggingSupporter
,OptionHandler
,SizeOfHandler
,Stoppable
,StoppableWithFeedback
,MissingValueSpreadSheetReader
,MultiSheetSpreadSheetReader<T>
,NoHeaderSpreadSheetReader
,SpreadSheetReader
,WindowedSpreadSheetReader
,DataRowTypeHandler
,SpreadSheetTypeHandler
,Serializable
- Direct Known Subclasses:
ExcelSpreadSheetReader
,ExcelStreamingSpreadSheetReader
public abstract class AbstractExcelSpreadSheetReader<T extends Range> extends AbstractMultiSheetSpreadSheetReaderWithMissingValueSupport<T> implements NoHeaderSpreadSheetReader, WindowedSpreadSheetReader
Ancestor for special Excel readers.- Author:
- fracpete (fracpete at waikato dot ac dot nz)
- See Also:
- Serialized Form
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from class adams.data.io.input.AbstractSpreadSheetReader
AbstractSpreadSheetReader.InputType
-
-
Field Summary
Fields Modifier and Type Field Description protected boolean
m_AutoExtendHeader
whether to automatically extend the header if rows have more cells than header.protected String
m_CustomColumnHeaders
the comma-separated list of column header names.protected int
m_FirstRow
the first row to retrieve (1-based).protected boolean
m_NoHeader
whether the file has a header or not.protected int
m_NumRows
the number of rows to retrieve (less than 1 = unlimited).protected Range
m_TextColumns
the range of columns to force to be text.-
Fields inherited from class adams.data.io.input.AbstractMultiSheetSpreadSheetReaderWithMissingValueSupport
m_MissingValue
-
Fields inherited from class adams.data.io.input.AbstractMultiSheetSpreadSheetReader
m_SheetRange
-
Fields inherited from class adams.data.io.input.AbstractSpreadSheetReader
m_DataRowType, m_Encoding, m_LastError, m_SpreadSheetType, m_Stopped, OPTION_INPUT, OPTION_OUTPUT
-
Fields inherited from class adams.core.option.AbstractOptionHandler
m_OptionManager
-
Fields inherited from class adams.core.logging.LoggingObject
m_Logger, m_LoggingIsEnabled, m_LoggingLevel
-
-
Constructor Summary
Constructors Constructor Description AbstractExcelSpreadSheetReader()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description String
autoExtendHeaderTipText()
Returns the tip text for this property.String
customColumnHeadersTipText()
Returns the tip text for this property.void
defineOptions()
Adds options to the internal list of options.String
firstRowTipText()
Returns the tip text for this property.boolean
getAutoExtendHeader()
Returns whether to extend the header if rows have more cells than the header.String
getCustomColumnHeaders()
Returns whether the file contains a header row or not.int
getFirstRow()
Returns the first row to return.boolean
getNoHeader()
Returns whether the file contains a header row or not.int
getNumRows()
Returns the number of data rows to return.Range
getTextColumns()
Returns the range of columns to treat as text.protected void
initialize()
Initializes the members.String
noHeaderTipText()
Returns the tip text for this property.String
numRowsTipText()
Returns the tip text for this property.void
setAutoExtendHeader(boolean value)
Sets whether to extend the header if rows have more cells than the header.void
setCustomColumnHeaders(String value)
Sets the custom headers to use.void
setFirstRow(int value)
Sets the first row to return.void
setNoHeader(boolean value)
Sets whether the file contains a header row or not.void
setNumRows(int value)
Sets the number of data rows to return.void
setTextColumns(Range value)
Sets the range of columns to treat as text.String
textColumnsTipText()
Returns the tip text for this property.-
Methods inherited from class adams.data.io.input.AbstractMultiSheetSpreadSheetReaderWithMissingValueSupport
getDefaultMissingValue, getMissingValue, missingValueTipText, setMissingValue
-
Methods inherited from class adams.data.io.input.AbstractMultiSheetSpreadSheetReader
doRead, doRead, doRead, doReadRange, doReadRange, doReadRange, getDefaultSheetRange, getSheetRange, readRange, readRange, readRange, readRange, setSheetRange, sheetRangeTipText
-
Methods inherited from class adams.data.io.input.AbstractSpreadSheetReader
canDecompress, check, dataRowTypeTipText, encodingTipText, getAdditionalInformation, getDataRowType, getDefaultDataRowType, getDefaultFormatExtension, getDefaultSpreadSheet, getEncoding, getFormatDescription, getFormatExtensions, getInputType, getLastError, getReaders, getSpreadSheetType, hasLastError, isStopped, read, read, read, read, runReader, setDataRowType, setEncoding, setLastError, setSpreadSheetType, spreadSheetTypeTipText, stopExecution, supportsCompressedInput
-
Methods inherited from class adams.core.option.AbstractOptionHandler
cleanUpOptions, destroy, finishInit, getDefaultLoggingLevel, getOptionManager, globalInfo, loggingLevelTipText, newOptionManager, reset, setLoggingLevel, toCommandLine, toString
-
Methods inherited from class adams.core.logging.LoggingObject
configureLogger, getLogger, getLoggingLevel, initializeLogging, isLoggingEnabled, sizeOf
-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
-
Methods inherited from interface adams.core.Destroyable
destroy
-
Methods inherited from interface adams.core.logging.LoggingLevelHandler
getLoggingLevel
-
Methods inherited from interface adams.core.option.OptionHandler
cleanUpOptions, getOptionManager, toCommandLine
-
Methods inherited from interface adams.data.io.input.SpreadSheetReader
dataRowTypeTipText, getCorrespondingWriter, getDataRowType, getDefaultFormatExtension, getFormatDescription, getFormatExtensions, getLastError, getSpreadSheetType, hasLastError, isStopped, read, read, read, read, setDataRowType, setSpreadSheetType, spreadSheetTypeTipText, stopExecution
-
-
-
-
Field Detail
-
m_AutoExtendHeader
protected boolean m_AutoExtendHeader
whether to automatically extend the header if rows have more cells than header.
-
m_TextColumns
protected Range m_TextColumns
the range of columns to force to be text.
-
m_NoHeader
protected boolean m_NoHeader
whether the file has a header or not.
-
m_CustomColumnHeaders
protected String m_CustomColumnHeaders
the comma-separated list of column header names.
-
m_FirstRow
protected int m_FirstRow
the first row to retrieve (1-based).
-
m_NumRows
protected int m_NumRows
the number of rows to retrieve (less than 1 = unlimited).
-
-
Method Detail
-
defineOptions
public void defineOptions()
Adds options to the internal list of options.- Specified by:
defineOptions
in interfaceOptionHandler
- Overrides:
defineOptions
in classAbstractMultiSheetSpreadSheetReaderWithMissingValueSupport<T extends Range>
-
initialize
protected void initialize()
Initializes the members.- Overrides:
initialize
in classAbstractSpreadSheetReader
-
setAutoExtendHeader
public void setAutoExtendHeader(boolean value)
Sets whether to extend the header if rows have more cells than the header.- Parameters:
value
- if true then the header gets extended if necessary
-
getAutoExtendHeader
public boolean getAutoExtendHeader()
Returns whether to extend the header if rows have more cells than the header.- Returns:
- true if the header gets extended if necessary
-
autoExtendHeaderTipText
public String autoExtendHeaderTipText()
Returns the tip text for this property.- Returns:
- tip text for this property suitable for displaying in the explorer/experimenter gui
-
setTextColumns
public void setTextColumns(Range value)
Sets the range of columns to treat as text.- Parameters:
value
- the range of columns
-
getTextColumns
public Range getTextColumns()
Returns the range of columns to treat as text.- Returns:
- the range of columns
-
textColumnsTipText
public String textColumnsTipText()
Returns the tip text for this property.- Returns:
- tip text for this property suitable for displaying in the explorer/experimenter gui
-
setNoHeader
public void setNoHeader(boolean value)
Sets whether the file contains a header row or not.- Specified by:
setNoHeader
in interfaceNoHeaderSpreadSheetReader
- Parameters:
value
- true if no header row available
-
getNoHeader
public boolean getNoHeader()
Returns whether the file contains a header row or not.- Specified by:
getNoHeader
in interfaceNoHeaderSpreadSheetReader
- Returns:
- true if no header row available
-
noHeaderTipText
public String noHeaderTipText()
Returns the tip text for this property.- Specified by:
noHeaderTipText
in interfaceNoHeaderSpreadSheetReader
- Returns:
- tip text for this property suitable for displaying in the gui
-
setCustomColumnHeaders
public void setCustomColumnHeaders(String value)
Sets the custom headers to use.- Specified by:
setCustomColumnHeaders
in interfaceNoHeaderSpreadSheetReader
- Parameters:
value
- the comma-separated list
-
getCustomColumnHeaders
public String getCustomColumnHeaders()
Returns whether the file contains a header row or not.- Specified by:
getCustomColumnHeaders
in interfaceNoHeaderSpreadSheetReader
- Returns:
- the comma-separated list
-
customColumnHeadersTipText
public String customColumnHeadersTipText()
Returns the tip text for this property.- Specified by:
customColumnHeadersTipText
in interfaceNoHeaderSpreadSheetReader
- Returns:
- tip text for this property suitable for displaying in the gui
-
setFirstRow
public void setFirstRow(int value)
Sets the first row to return.- Specified by:
setFirstRow
in interfaceWindowedSpreadSheetReader
- Parameters:
value
- the first row (1-based), greater than 0
-
getFirstRow
public int getFirstRow()
Returns the first row to return.- Specified by:
getFirstRow
in interfaceWindowedSpreadSheetReader
- Returns:
- the first row (1-based), greater than 0
-
firstRowTipText
public String firstRowTipText()
Returns the tip text for this property.- Specified by:
firstRowTipText
in interfaceWindowedSpreadSheetReader
- Returns:
- tip text for this property suitable for displaying in the GUI or for listing the options.
-
setNumRows
public void setNumRows(int value)
Sets the number of data rows to return.- Specified by:
setNumRows
in interfaceWindowedSpreadSheetReader
- Parameters:
value
- the number of rows, -1 for unlimited
-
getNumRows
public int getNumRows()
Returns the number of data rows to return.- Specified by:
getNumRows
in interfaceWindowedSpreadSheetReader
- Returns:
- the number of rows, -1 for unlimited
-
numRowsTipText
public String numRowsTipText()
Returns the tip text for this property.- Specified by:
numRowsTipText
in interfaceWindowedSpreadSheetReader
- Returns:
- tip text for this property suitable for displaying in the GUI or for listing the options.
-
-