Package adams.data.io.input
Class ObjectLocationsSpreadSheetReader
- java.lang.Object
-
- adams.core.logging.LoggingObject
-
- adams.core.logging.CustomLoggingLevelObject
-
- adams.core.option.AbstractOptionHandler
-
- adams.data.io.input.AbstractReportReader<Report>
-
- adams.data.io.input.ObjectLocationsSpreadSheetReader
-
- All Implemented Interfaces:
CleanUpHandler
,Destroyable
,GlobalInfoSupporter
,FileFormatHandler
,LoggingLevelHandler
,LoggingSupporter
,OptionHandler
,ShallowCopySupporter<AbstractReportReader>
,SizeOfHandler
,Stoppable
,StoppableWithFeedback
,ReportReader<Report>
,StringReportReader<Report>
,ObjectPrefixHandler
,Serializable
,Comparable
public class ObjectLocationsSpreadSheetReader extends AbstractReportReader<Report> implements ObjectPrefixHandler, StringReportReader<Report>
Reads object locations from a spreadsheet into a report.
Top/left column is required.
Either right/bottom or width/height need to be supplied.
In addition, polygon coordinates (X and Y coordinates as comma-separated lists in two separate columns) can be read as well.
If the coordinates/dimensions represent normalized ones (ie 0-1), then specify the width/height of the image to relate them back to actual pixel-based sizes.
-logging-level <OFF|SEVERE|WARNING|INFO|CONFIG|FINE|FINER|FINEST> (property: loggingLevel) The logging level for outputting errors and debugging output. default: WARNING
-input <adams.core.io.PlaceholderFile> (property: input) The file to read and turn into a report. default: ${CWD}
-reader <adams.data.io.input.SpreadSheetReader> (property: reader) The reader to use for reading the spreadsheet data. default: adams.data.io.input.CsvSpreadSheetReader -data-row-type adams.data.spreadsheet.DenseDataRow -spreadsheet-type adams.data.spreadsheet.DefaultSpreadSheet
-row-finder <adams.data.spreadsheet.rowfinder.RowFinder> (property: rowFinder) The row finder to use for selecting a subset before extracting object locations. default: adams.data.spreadsheet.rowfinder.AllFinder
-col-left <adams.data.spreadsheet.SpreadSheetColumnIndex> (property: colLeft) The column containing the left coordinate. default: example: An index is a number starting with 1; column names (case-sensitive) as well as the following placeholders can be used: first, second, third, last_2, last_1, last; numeric indices can be enforced by preceding them with '#' (eg '#12'); column names can be surrounded by double quotes.
-col-top <adams.data.spreadsheet.SpreadSheetColumnIndex> (property: colTop) The column containing the top coordinate. default: example: An index is a number starting with 1; column names (case-sensitive) as well as the following placeholders can be used: first, second, third, last_2, last_1, last; numeric indices can be enforced by preceding them with '#' (eg '#12'); column names can be surrounded by double quotes.
-col-right <adams.data.spreadsheet.SpreadSheetColumnIndex> (property: colRight) The column containing the right coordinate. default: example: An index is a number starting with 1; column names (case-sensitive) as well as the following placeholders can be used: first, second, third, last_2, last_1, last; numeric indices can be enforced by preceding them with '#' (eg '#12'); column names can be surrounded by double quotes.
-col-bottom <adams.data.spreadsheet.SpreadSheetColumnIndex> (property: colBottom) The column containing the bottom coordinate. default: example: An index is a number starting with 1; column names (case-sensitive) as well as the following placeholders can be used: first, second, third, last_2, last_1, last; numeric indices can be enforced by preceding them with '#' (eg '#12'); column names can be surrounded by double quotes.
-col-width <adams.data.spreadsheet.SpreadSheetColumnIndex> (property: colWidth) The column containing the width coordinate. default: example: An index is a number starting with 1; column names (case-sensitive) as well as the following placeholders can be used: first, second, third, last_2, last_1, last; numeric indices can be enforced by preceding them with '#' (eg '#12'); column names can be surrounded by double quotes.
-col-height <adams.data.spreadsheet.SpreadSheetColumnIndex> (property: colHeight) The column containing the height coordinate. default: example: An index is a number starting with 1; column names (case-sensitive) as well as the following placeholders can be used: first, second, third, last_2, last_1, last; numeric indices can be enforced by preceding them with '#' (eg '#12'); column names can be surrounded by double quotes.
-col-polygon-x <adams.data.spreadsheet.SpreadSheetColumnIndex> (property: colPolygonX) The column containing the X coordinates of the polygon (comma-separated list of coordinates); cannot be used without bounding box. default: example: An index is a number starting with 1; column names (case-sensitive) as well as the following placeholders can be used: first, second, third, last_2, last_1, last; numeric indices can be enforced by preceding them with '#' (eg '#12'); column names can be surrounded by double quotes.
-col-polygon-y <adams.data.spreadsheet.SpreadSheetColumnIndex> (property: colPolygonY) The column containing the Y coordinates of the polygon (comma-separated list of coordinates); cannot be used without bounding box. default: example: An index is a number starting with 1; column names (case-sensitive) as well as the following placeholders can be used: first, second, third, last_2, last_1, last; numeric indices can be enforced by preceding them with '#' (eg '#12'); column names can be surrounded by double quotes.
-col-type <adams.data.spreadsheet.SpreadSheetColumnIndex> (property: colType) The column containing the object label. default: example: An index is a number starting with 1; column names (case-sensitive) as well as the following placeholders can be used: first, second, third, last_2, last_1, last; numeric indices can be enforced by preceding them with '#' (eg '#12'); column names can be surrounded by double quotes.
-range-meta-data <adams.data.spreadsheet.SpreadSheetColumnRange> (property: rangeMetaData) The columns to store as meta-data; all other columns get automatically excluded from the meta-data. default: example: A range is a comma-separated list of single 1-based indices or sub-ranges of indices ('start-end'); 'inv(...)' inverts the range '...'; column names (case-sensitive) as well as the following placeholders can be used: first, second, third, last_2, last_1, last; numeric indices can be enforced by preceding them with '#' (eg '#12'); column names can be surrounded by double quotes.
-use-normalized <boolean> (property: useNormalized) If enabled, the coordinates/dimensions are interpreted as normalized (0- 1) rather than absolute pixels. default: false
-width <int> (property: width) The width of the image to use when reading normalized coordinates/dimensions. default: 1000 minimum: 1
-height <int> (property: height) The height of the image to use when reading normalized coordinates/dimensions. default: 1000 minimum: 1
-prefix <java.lang.String> (property: prefix) The report field prefix used in the report. default: Object.
-label-suffix <java.lang.String> (property: labelSuffix) The suffix to use in the report for labels. default: type
- Author:
- FracPete (fracpete at waikato dot ac dot nz)
- See Also:
- Serialized Form
-
-
Field Summary
Fields Modifier and Type Field Description protected SpreadSheetColumnIndex
m_ColBottom
the column with the bottom coordinate.protected SpreadSheetColumnIndex
m_ColHeight
the column with the height.protected SpreadSheetColumnIndex
m_ColLeft
the column with the left coordinate.protected SpreadSheetColumnIndex
m_ColPolygonX
the column with the polygon X coordinates.protected SpreadSheetColumnIndex
m_ColPolygonY
the column with the polygon Y coordinates.protected SpreadSheetColumnIndex
m_ColRight
the column with the right coordinate.protected SpreadSheetColumnIndex
m_ColTop
the column with the top coordinate.protected SpreadSheetColumnIndex
m_ColType
the column with the label.protected SpreadSheetColumnIndex
m_ColWidth
the column with the width.protected int
m_Height
the image height to use as basis for normalized coordinates/dimensions.protected String
m_LabelSuffix
the label suffix to use.protected String
m_Prefix
the prefix to use.protected SpreadSheetColumnRange
m_RangeMetaData
the columns with meta-data.protected SpreadSheetReader
m_Reader
the spreadsheet reader to use.protected RowFinder
m_RowFinder
the row finder to apply before extracting the objects.protected boolean
m_UseNormalized
whether to use normalized coordinates/dimensions.protected int
m_Width
the image width to use as basis for normalized coordinates/dimensions.-
Fields inherited from class adams.data.io.input.AbstractReportReader
m_Input, m_Stopped
-
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 ObjectLocationsSpreadSheetReader()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description String
colBottomTipText()
Returns the tip text for this property.String
colHeightTipText()
Returns the tip text for this property.String
colLeftTipText()
Returns the tip text for this property.String
colPolygonXTipText()
Returns the tip text for this property.String
colPolygonYTipText()
Returns the tip text for this property.String
colRightTipText()
Returns the tip text for this property.String
colTopTipText()
Returns the tip text for this property.String
colTypeTipText()
Returns the tip text for this property.String
colWidthTipText()
Returns the tip text for this property.protected List<Report>
convert(SpreadSheet sheet)
Converts the spreadsheet into report(s).protected String
coordsToList(double[] coords)
Turns the coordinates into a comma-separated list.void
defineOptions()
Adds options to the internal list of options.protected int
determineParentID(Report report)
Tries to determine the parent ID for the current report.SpreadSheetColumnIndex
getColBottom()
Returns the column containing the bottom coordinate.SpreadSheetColumnIndex
getColHeight()
Returns the column containing the height coordinate.SpreadSheetColumnIndex
getColLeft()
Returns the column containing the left coordinate.SpreadSheetColumnIndex
getColPolygonX()
Returns the column containing the X coordinates of the polygon (comma-separated list of coordinates).SpreadSheetColumnIndex
getColPolygonY()
Returns the column containing the Y coordinates of the polygon (comma-separated list of coordinates).SpreadSheetColumnIndex
getColRight()
Returns the column containing the right coordinate.SpreadSheetColumnIndex
getColTop()
Returns the column containing the top coordinate.SpreadSheetColumnIndex
getColType()
Returns the column containing the object label.SpreadSheetColumnIndex
getColWidth()
Returns the column containing the width coordinate.String
getFormatDescription()
Returns a string describing the format (used in the file chooser).String[]
getFormatExtensions()
Returns the extension(s) of the format.int
getHeight()
Returns the height of the image to use when reading normalized coordinates/dimensions.String
getLabelSuffix()
Returns the field suffix used in the report for labels.String
getPrefix()
Returns the field prefix used in the report.SpreadSheetColumnRange
getRangeMetaData()
Returns the range of columns to store as meta-data.SpreadSheetReader
getReader()
Returns the spreadsheet reader in use.RowFinder
getRowFinder()
Returns the row finder to use for selecting a subset before extracting object locations.boolean
getUseNormalized()
Returns whether the coordinates/dimensions are interpreted as normalized (0-1) rather than absolute pixels.int
getWidth()
Returns the width of the image to use when reading normalized coordinates/dimensions.String
globalInfo()
Returns a string describing the object.String
heightTipText()
Returns the tip text for this property.String
labelSuffixTipText()
Returns the tip text for this property.protected double[]
multipleCoords(double[] coords, double factor)
Multiplies the coordinates by the specified factor (in-place).Report
newInstance()
Returns a new instance of the report class in use.protected double[]
parseCoords(String coords)
Parses comma-separated list of coordinates and returns a double array.String
prefixTipText()
Returns the tip text for this property.String
rangeMetaDataTipText()
Returns the tip text for this property.List<Report>
read(String s)
Reads the data.protected List<Report>
readData()
Performs the actual reading.String
readerTipText()
Returns the tip text for this property.String
rowFinderTipText()
Returns the tip text for this property.void
setColBottom(SpreadSheetColumnIndex value)
Sets the column containing the bottom coordinate.void
setColHeight(SpreadSheetColumnIndex value)
Sets the column containing the height coordinate.void
setColLeft(SpreadSheetColumnIndex value)
Sets the column containing the left coordinate.void
setColPolygonX(SpreadSheetColumnIndex value)
Sets the column containing the X coordinates of the polygon (comma-separated list of coordinates).void
setColPolygonY(SpreadSheetColumnIndex value)
Sets the column containing the Y coordinates of the polygon (comma-separated list of coordinates).void
setColRight(SpreadSheetColumnIndex value)
Sets the column containing the right coordinate.void
setColTop(SpreadSheetColumnIndex value)
Sets the column containing the top coordinate.void
setColType(SpreadSheetColumnIndex value)
Sets the column containing the object label.void
setColWidth(SpreadSheetColumnIndex value)
Sets the column containing the width coordinate.void
setHeight(int value)
Sets the height of the image to use when reading normalized coordinates/dimensions.void
setLabelSuffix(String value)
Sets the field suffix used in the report for labels.void
setPrefix(String value)
Sets the field prefix used in the report.void
setRangeMetaData(SpreadSheetColumnRange value)
Sets the range of columns to store as meta-data.void
setReader(SpreadSheetReader value)
Sets the spreadsheet reader to use.void
setRowFinder(RowFinder value)
Sets the row finder to use for selecting a subset before extracting object locations.void
setUseNormalized(boolean value)
Sets whether the coordinates/dimensions are interpreted as normalized (0-1) rather than absolute pixels.void
setWidth(int value)
Sets the width of the image to use when reading normalized coordinates/dimensions.String
useNormalizedTipText()
Returns the tip text for this property.String
widthTipText()
Returns the tip text for this property.-
Methods inherited from class adams.data.io.input.AbstractReportReader
checkData, cleanUp, compareTo, destroy, equals, forCommandLine, forName, getDefaultFormatExtension, getInput, getReaders, inputTipText, isStopped, postRead, read, reset, setInput, shallowCopy, shallowCopy, stopExecution
-
Methods inherited from class adams.core.option.AbstractOptionHandler
cleanUpOptions, finishInit, getDefaultLoggingLevel, getOptionManager, initialize, loggingLevelTipText, newOptionManager, 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, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
-
Methods inherited from interface adams.core.logging.LoggingLevelHandler
getLoggingLevel
-
Methods inherited from interface adams.data.io.input.ReportReader
getInput, inputTipText, read, setInput
-
-
-
-
Field Detail
-
m_Reader
protected SpreadSheetReader m_Reader
the spreadsheet reader to use.
-
m_RowFinder
protected RowFinder m_RowFinder
the row finder to apply before extracting the objects.
-
m_ColLeft
protected SpreadSheetColumnIndex m_ColLeft
the column with the left coordinate.
-
m_ColTop
protected SpreadSheetColumnIndex m_ColTop
the column with the top coordinate.
-
m_ColRight
protected SpreadSheetColumnIndex m_ColRight
the column with the right coordinate.
-
m_ColBottom
protected SpreadSheetColumnIndex m_ColBottom
the column with the bottom coordinate.
-
m_ColWidth
protected SpreadSheetColumnIndex m_ColWidth
the column with the width.
-
m_ColHeight
protected SpreadSheetColumnIndex m_ColHeight
the column with the height.
-
m_ColPolygonX
protected SpreadSheetColumnIndex m_ColPolygonX
the column with the polygon X coordinates.
-
m_ColPolygonY
protected SpreadSheetColumnIndex m_ColPolygonY
the column with the polygon Y coordinates.
-
m_ColType
protected SpreadSheetColumnIndex m_ColType
the column with the label.
-
m_RangeMetaData
protected SpreadSheetColumnRange m_RangeMetaData
the columns with meta-data.
-
m_UseNormalized
protected boolean m_UseNormalized
whether to use normalized coordinates/dimensions.
-
m_Width
protected int m_Width
the image width to use as basis for normalized coordinates/dimensions.
-
m_Height
protected int m_Height
the image height to use as basis for normalized coordinates/dimensions.
-
m_Prefix
protected String m_Prefix
the prefix to use.
-
m_LabelSuffix
protected String m_LabelSuffix
the label suffix to use.
-
-
Method Detail
-
globalInfo
public String globalInfo()
Returns a string describing the object.- Specified by:
globalInfo
in interfaceGlobalInfoSupporter
- Specified by:
globalInfo
in classAbstractOptionHandler
- Returns:
- a description suitable for displaying in the gui
-
defineOptions
public void defineOptions()
Adds options to the internal list of options.- Specified by:
defineOptions
in interfaceOptionHandler
- Overrides:
defineOptions
in classAbstractReportReader<Report>
-
setReader
public void setReader(SpreadSheetReader value)
Sets the spreadsheet reader to use.- Parameters:
value
- the reader
-
getReader
public SpreadSheetReader getReader()
Returns the spreadsheet reader in use.- Returns:
- the reader
-
readerTipText
public String readerTipText()
Returns the tip text for this property.- Returns:
- tip text for this property suitable for displaying in the GUI or for listing the options.
-
setRowFinder
public void setRowFinder(RowFinder value)
Sets the row finder to use for selecting a subset before extracting object locations.- Parameters:
value
- the finder
-
getRowFinder
public RowFinder getRowFinder()
Returns the row finder to use for selecting a subset before extracting object locations.- Returns:
- the finder
-
rowFinderTipText
public String rowFinderTipText()
Returns the tip text for this property.- Returns:
- tip text for this property suitable for displaying in the GUI or for listing the options.
-
setColLeft
public void setColLeft(SpreadSheetColumnIndex value)
Sets the column containing the left coordinate.- Parameters:
value
- the column
-
getColLeft
public SpreadSheetColumnIndex getColLeft()
Returns the column containing the left coordinate.- Returns:
- the column
-
colLeftTipText
public String colLeftTipText()
Returns the tip text for this property.- Returns:
- tip text for this property suitable for displaying in the GUI or for listing the options.
-
setColTop
public void setColTop(SpreadSheetColumnIndex value)
Sets the column containing the top coordinate.- Parameters:
value
- the column
-
getColTop
public SpreadSheetColumnIndex getColTop()
Returns the column containing the top coordinate.- Returns:
- the column
-
colTopTipText
public String colTopTipText()
Returns the tip text for this property.- Returns:
- tip text for this property suitable for displaying in the GUI or for listing the options.
-
setColRight
public void setColRight(SpreadSheetColumnIndex value)
Sets the column containing the right coordinate.- Parameters:
value
- the column
-
getColRight
public SpreadSheetColumnIndex getColRight()
Returns the column containing the right coordinate.- Returns:
- the column
-
colRightTipText
public String colRightTipText()
Returns the tip text for this property.- Returns:
- tip text for this property suitable for displaying in the GUI or for listing the options.
-
setColBottom
public void setColBottom(SpreadSheetColumnIndex value)
Sets the column containing the bottom coordinate.- Parameters:
value
- the column
-
getColBottom
public SpreadSheetColumnIndex getColBottom()
Returns the column containing the bottom coordinate.- Returns:
- the column
-
colBottomTipText
public String colBottomTipText()
Returns the tip text for this property.- Returns:
- tip text for this property suitable for displaying in the GUI or for listing the options.
-
setColWidth
public void setColWidth(SpreadSheetColumnIndex value)
Sets the column containing the width coordinate.- Parameters:
value
- the column
-
getColWidth
public SpreadSheetColumnIndex getColWidth()
Returns the column containing the width coordinate.- Returns:
- the column
-
colWidthTipText
public String colWidthTipText()
Returns the tip text for this property.- Returns:
- tip text for this property suitable for displaying in the GUI or for listing the options.
-
setColHeight
public void setColHeight(SpreadSheetColumnIndex value)
Sets the column containing the height coordinate.- Parameters:
value
- the column
-
getColHeight
public SpreadSheetColumnIndex getColHeight()
Returns the column containing the height coordinate. Cannot be used without bounding box.- Returns:
- the column
-
colHeightTipText
public String colHeightTipText()
Returns the tip text for this property.- Returns:
- tip text for this property suitable for displaying in the GUI or for listing the options.
-
setColPolygonX
public void setColPolygonX(SpreadSheetColumnIndex value)
Sets the column containing the X coordinates of the polygon (comma-separated list of coordinates). Cannot be used without bounding box.- Parameters:
value
- the column
-
getColPolygonX
public SpreadSheetColumnIndex getColPolygonX()
Returns the column containing the X coordinates of the polygon (comma-separated list of coordinates).- Returns:
- the column
-
colPolygonXTipText
public String colPolygonXTipText()
Returns the tip text for this property.- Returns:
- tip text for this property suitable for displaying in the GUI or for listing the options.
-
setColPolygonY
public void setColPolygonY(SpreadSheetColumnIndex value)
Sets the column containing the Y coordinates of the polygon (comma-separated list of coordinates). Cannot be used without bounding box.- Parameters:
value
- the column
-
getColPolygonY
public SpreadSheetColumnIndex getColPolygonY()
Returns the column containing the Y coordinates of the polygon (comma-separated list of coordinates). Cannot be used without bounding box.- Returns:
- the column
-
colPolygonYTipText
public String colPolygonYTipText()
Returns the tip text for this property.- Returns:
- tip text for this property suitable for displaying in the GUI or for listing the options.
-
setColType
public void setColType(SpreadSheetColumnIndex value)
Sets the column containing the object label.- Parameters:
value
- the column
-
getColType
public SpreadSheetColumnIndex getColType()
Returns the column containing the object label.- Returns:
- the column
-
colTypeTipText
public String colTypeTipText()
Returns the tip text for this property.- Returns:
- tip text for this property suitable for displaying in the GUI or for listing the options.
-
setUseNormalized
public void setUseNormalized(boolean value)
Sets whether the coordinates/dimensions are interpreted as normalized (0-1) rather than absolute pixels.- Parameters:
value
- true if normalized
-
getUseNormalized
public boolean getUseNormalized()
Returns whether the coordinates/dimensions are interpreted as normalized (0-1) rather than absolute pixels.- Returns:
- true if normalized
-
useNormalizedTipText
public String useNormalizedTipText()
Returns the tip text for this property.- Returns:
- tip text for this property suitable for displaying in the GUI or for listing the options.
-
setWidth
public void setWidth(int value)
Sets the width of the image to use when reading normalized coordinates/dimensions.- Parameters:
value
- the image width
-
getWidth
public int getWidth()
Returns the width of the image to use when reading normalized coordinates/dimensions.- Returns:
- the image width
-
widthTipText
public String widthTipText()
Returns the tip text for this property.- Returns:
- tip text for this property suitable for displaying in the GUI or for listing the options.
-
setHeight
public void setHeight(int value)
Sets the height of the image to use when reading normalized coordinates/dimensions.- Parameters:
value
- the image height
-
getHeight
public int getHeight()
Returns the height of the image to use when reading normalized coordinates/dimensions.- Returns:
- the image height
-
heightTipText
public String heightTipText()
Returns the tip text for this property.- Returns:
- tip text for this property suitable for displaying in the GUI or for listing the options.
-
setRangeMetaData
public void setRangeMetaData(SpreadSheetColumnRange value)
Sets the range of columns to store as meta-data.- Parameters:
value
- the column range
-
getRangeMetaData
public SpreadSheetColumnRange getRangeMetaData()
Returns the range of columns to store as meta-data.- Returns:
- the column range
-
rangeMetaDataTipText
public String rangeMetaDataTipText()
Returns the tip text for this property.- Returns:
- tip text for this property suitable for displaying in the GUI or for listing the options.
-
setPrefix
public void setPrefix(String value)
Sets the field prefix used in the report.- Specified by:
setPrefix
in interfaceObjectPrefixHandler
- Parameters:
value
- the field prefix
-
getPrefix
public String getPrefix()
Returns the field prefix used in the report.- Specified by:
getPrefix
in interfaceObjectPrefixHandler
- Returns:
- the field prefix
-
prefixTipText
public String prefixTipText()
Returns the tip text for this property.- Specified by:
prefixTipText
in interfaceObjectPrefixHandler
- Returns:
- tip text for this property suitable for displaying in the GUI or for listing the options.
-
setLabelSuffix
public void setLabelSuffix(String value)
Sets the field suffix used in the report for labels.- Parameters:
value
- the field suffix
-
getLabelSuffix
public String getLabelSuffix()
Returns the field suffix used in the report for labels.- Returns:
- the field suffix
-
labelSuffixTipText
public String labelSuffixTipText()
Returns the tip text for this property.- Returns:
- tip text for this property suitable for displaying in the GUI or for listing the options.
-
getFormatDescription
public String getFormatDescription()
Returns a string describing the format (used in the file chooser).- Specified by:
getFormatDescription
in interfaceFileFormatHandler
- Specified by:
getFormatDescription
in classAbstractReportReader<Report>
- Returns:
- a description suitable for displaying in the file chooser
-
getFormatExtensions
public String[] getFormatExtensions()
Returns the extension(s) of the format.- Specified by:
getFormatExtensions
in interfaceFileFormatHandler
- Specified by:
getFormatExtensions
in classAbstractReportReader<Report>
- Returns:
- the extension(s) (without the dot!)
-
newInstance
public Report newInstance()
Returns a new instance of the report class in use.- Specified by:
newInstance
in classAbstractReportReader<Report>
- Returns:
- the new (empty) report
-
determineParentID
protected int determineParentID(Report report)
Tries to determine the parent ID for the current report.- Specified by:
determineParentID
in classAbstractReportReader<Report>
- Parameters:
report
- the report to determine the ID for- Returns:
- the parent database ID, -1 if it cannot be determined
-
parseCoords
protected double[] parseCoords(String coords)
Parses comma-separated list of coordinates and returns a double array.- Parameters:
coords
- the coordinates to parse- Returns:
- the parsed values, empty array if failed to parse
-
multipleCoords
protected double[] multipleCoords(double[] coords, double factor)
Multiplies the coordinates by the specified factor (in-place).- Parameters:
coords
- the coordinates to updatefactor
- the factor to use- Returns:
- the updated coordinates
-
coordsToList
protected String coordsToList(double[] coords)
Turns the coordinates into a comma-separated list.- Parameters:
coords
- the coordinates to convert- Returns:
- the comma-separated list
-
convert
protected List<Report> convert(SpreadSheet sheet)
Converts the spreadsheet into report(s).- Parameters:
sheet
- the spreadsheet to convert- Returns:
- the reports that were read
-
readData
protected List<Report> readData()
Performs the actual reading.- Specified by:
readData
in classAbstractReportReader<Report>
- Returns:
- the reports that were read
-
-