Package adams.data.io.input
Class OpexObjectLocationsReader
- 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.OpexObjectLocationsReader
-
- All Implemented Interfaces:
CleanUpHandler
,Destroyable
,GlobalInfoSupporter
,FileFormatHandler
,LoggingLevelHandler
,LoggingSupporter
,OptionHandler
,ShallowCopySupporter<AbstractReportReader>
,SizeOfHandler
,Stoppable
,StoppableWithFeedback
,ReportReader<Report>
,StringReportReader<Report>
,ObjectPrefixHandler
,Serializable
,Comparable
public class OpexObjectLocationsReader extends AbstractReportReader<Report> implements ObjectPrefixHandler, StringReportReader<Report>
Reads object locations from JSON generated by the opex library.
See more:
https://github.com/WaikatoLink2020/objdet-predictions-exchange-format
-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}
-id <adams.data.report.Field> (property: ID) The field to use for storing the ID. default: ID[S]
-timestamp <adams.data.report.Field> (property: timestamp) The field to use for storing the timestamp. default: Timestamp[S]
-prefix <java.lang.String> (property: prefix) The report field prefix used in the report for the objects. default: Object.
-label-suffix <java.lang.String> (property: labelSuffix) The suffix to use in the report for labels. default: type
-score-suffix <java.lang.String> (property: scoreSuffix) The suffix to use in the report for scores. default: score
-meta-prefix <java.lang.String> (property: metaPrefix) The report field prefix used in the report for the meta-data. default: Meta.
- Author:
- fracpete (fracpete at waikato dot ac dot nz)
- See Also:
- Serialized Form
-
-
Field Summary
Fields Modifier and Type Field Description protected Field
m_ID
the field to use for the ID.protected String
m_LabelSuffix
the label suffix to use.protected String
m_MetaPrefix
the prefix for the meta-data.protected String
m_Prefix
the prefix to use for objects.protected String
m_ScoreSuffix
the score suffix to use.protected Field
m_Timestamp
the field to use for the timestamp.-
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 OpexObjectLocationsReader()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description 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.String
getFormatDescription()
Returns a string describing the format (used in the file chooser).String[]
getFormatExtensions()
Returns the extension(s) of the format.Field
getID()
Returns the field to use for the ID.String
getLabelSuffix()
Returns the field suffix used in the report for labels.String
getMetaPrefix()
Returns the field prefix used in the report for the meta-data.String
getPrefix()
Returns the field prefix used in the report for the objects.String
getScoreSuffix()
Returns the field suffix used in the report for scores.Field
getTimestamp()
Returns the field to use for the timestamp.String
globalInfo()
Returns a string describing the object.String
IDTipText()
Returns the tip text for this property.String
labelSuffixTipText()
Returns the tip text for this property.String
metaPrefixTipText()
Returns the tip text for this property.Report
newInstance()
Returns a new instance of the report class in use.String
prefixTipText()
Returns the tip text for this property.List<Report>
read(String s)
Reads the data.protected List<Report>
readData()
Performs the actual reading.protected List<Report>
readData(opex4j.ObjectPredictions preds)
Converts the predictions into a report.String
scoreSuffixTipText()
Returns the tip text for this property.void
setID(Field value)
Sets the field to use for the ID.void
setLabelSuffix(String value)
Sets the field suffix used in the report for labels.void
setMetaPrefix(String value)
Sets the field prefix used in the report for the meta-data.void
setPrefix(String value)
Sets the field prefix used in the report for the objects.void
setScoreSuffix(String value)
Sets the field suffix used in the report for scores.void
setTimestamp(Field value)
Sets the field to use for the timestamp.String
timestampTipText()
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_ID
protected Field m_ID
the field to use for the ID.
-
m_Timestamp
protected Field m_Timestamp
the field to use for the timestamp.
-
m_Prefix
protected String m_Prefix
the prefix to use for objects.
-
m_LabelSuffix
protected String m_LabelSuffix
the label suffix to use.
-
m_ScoreSuffix
protected String m_ScoreSuffix
the score suffix to use.
-
m_MetaPrefix
protected String m_MetaPrefix
the prefix for the meta-data.
-
-
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>
-
setID
public void setID(Field value)
Sets the field to use for the ID.- Parameters:
value
- the field
-
getID
public Field getID()
Returns the field to use for the ID.- Returns:
- the field
-
IDTipText
public String IDTipText()
Returns the tip text for this property.- Returns:
- tip text for this property suitable for displaying in the GUI or for listing the options.
-
setTimestamp
public void setTimestamp(Field value)
Sets the field to use for the timestamp.- Parameters:
value
- the field
-
getTimestamp
public Field getTimestamp()
Returns the field to use for the timestamp.- Returns:
- the field
-
timestampTipText
public String timestampTipText()
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 for the objects.- Specified by:
setPrefix
in interfaceObjectPrefixHandler
- Parameters:
value
- the field prefix
-
getPrefix
public String getPrefix()
Returns the field prefix used in the report for the objects.- 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.
-
setScoreSuffix
public void setScoreSuffix(String value)
Sets the field suffix used in the report for scores.- Parameters:
value
- the field suffix
-
getScoreSuffix
public String getScoreSuffix()
Returns the field suffix used in the report for scores.- Returns:
- the field suffix
-
scoreSuffixTipText
public String scoreSuffixTipText()
Returns the tip text for this property.- Returns:
- tip text for this property suitable for displaying in the GUI or for listing the options.
-
setMetaPrefix
public void setMetaPrefix(String value)
Sets the field prefix used in the report for the meta-data.- Parameters:
value
- the field prefix
-
getMetaPrefix
public String getMetaPrefix()
Returns the field prefix used in the report for the meta-data.- Returns:
- the field prefix
-
metaPrefixTipText
public String metaPrefixTipText()
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!)
-
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
-
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
-
readData
protected List<Report> readData(opex4j.ObjectPredictions preds)
Converts the predictions into a report.- Parameters:
preds
- the predictions 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
-
-