Package adams.flow.transformer
Class AbstractArrayProvider
- java.lang.Object
-
- adams.core.logging.LoggingObject
-
- adams.core.logging.CustomLoggingLevelObject
-
- adams.core.option.AbstractOptionHandler
-
- adams.flow.core.AbstractActor
-
- adams.flow.transformer.AbstractTransformer
-
- adams.flow.transformer.AbstractArrayProvider
-
- All Implemented Interfaces:
AdditionalInformationHandler
,ArrayProvider
,CleanUpHandler
,Destroyable
,GlobalInfoSupporter
,LoggingLevelHandler
,LoggingSupporter
,OptionHandler
,QuickInfoSupporter
,ShallowCopySupporter<Actor>
,SizeOfHandler
,Stoppable
,StoppableWithFeedback
,VariablesInspectionHandler
,VariableChangeListener
,Actor
,ArrayProvider
,ErrorHandler
,InputConsumer
,OutputProducer
,Serializable
,Comparable
- Direct Known Subclasses:
AbstractDbArrayProvider
,AbstractReportFileReader
,AccessDatabaseInfo
,ArrayHistogramRanges
,BoofCVMultiImageOperation
,BoofCVTransformer
,BufferedImageMultiImageOperation
,BufferedImageTransformer
,ControlChart
,EmailFileReader
,GetImageObjectIndices
,GetImageObjects
,GetJsonKeys
,GetJsonValue
,GetMapKeys
,GetProperties
,GetPropertyNames
,GetPropertyValue
,GroupByRegExp
,LocateObjects
,Mat5ArrayInfo
,Mat5FileInfo
,Mat5StructInfo
,MatchReportFields
,MultiMat5MatrixOperation
,OpenCVMultiImageOperation
,OpenCVTransformer
,PDFInfo
,PrepareFileBasedDataset
,ReportField
,SpreadSheetCellFinder
,SpreadSheetColumnIterator
,SpreadSheetExtractArray
,SpreadSheetFileReader
,SpreadSheetGetCell
,SpreadSheetHistogramRanges
,SpreadSheetInfo
,SpreadSheetPlotGenerator
,SpreadSheetRowToTimeseries
,SpreadSheetToTimeseries
,StringArraySplit
,StringJoin
,TimeseriesSplit
,ViaAnnotationsToReports
,WekaAttributeIterator
,WekaEvaluationPostProcessor
,WekaGeneticAlgorithm
,WekaInstancesHistogramRanges
,WekaInstancesInfo
,WekaRandomSplit
,WekaSplitGenerator
public abstract class AbstractArrayProvider extends AbstractTransformer implements ArrayProvider
Ancestor for transformer actors that can output items one by one or as a single array.- Author:
- fracpete (fracpete at waikato dot ac dot nz)
- See Also:
- Serialized Form
-
-
Field Summary
Fields Modifier and Type Field Description static String
BACKUP_INDEX
the key for storing the index in the backup.static String
BACKUP_QUEUE
the key for storing the elements in the backup.protected int
m_Index
the current index.protected boolean
m_OutputArray
whether to output an array instead of single items.protected ArrayList
m_Queue
contains the items.-
Fields inherited from class adams.flow.transformer.AbstractTransformer
BACKUP_INPUT, BACKUP_OUTPUT, m_InputToken, m_OutputToken
-
Fields inherited from class adams.flow.core.AbstractActor
m_Annotations, m_BackupState, m_DetectedObjectVariables, m_DetectedVariables, m_ErrorHandler, m_Executed, m_Executing, m_ExecutionListeningSupporter, m_FullName, m_LoggingPrefix, m_Name, m_Parent, m_ScopeHandler, m_Self, m_Silent, m_Skip, m_StopFlowOnError, m_StopMessage, m_Stopped, m_StorageHandler, m_VariablesUpdated
-
Fields inherited from class adams.core.option.AbstractOptionHandler
m_OptionManager
-
Fields inherited from class adams.core.logging.LoggingObject
m_Logger, m_LoggingIsEnabled, m_LoggingLevel
-
Fields inherited from interface adams.flow.core.Actor
FILE_EXTENSION, FILE_EXTENSION_GZ
-
-
Constructor Summary
Constructors Constructor Description AbstractArrayProvider()
-
Method Summary
All Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description protected Hashtable<String,Object>
backupState()
Backs up the current state of the actor before update the variables.void
defineOptions()
Adds options to the internal list of options.Class[]
generates()
Returns the class of objects that it generates.protected abstract Class
getItemClass()
Returns the base class of the items.boolean
getOutputArray()
Returns whether to output the items as array or as single strings.boolean
hasPendingOutput()
Checks whether there is pending output to be collected after executing the flow item.Token
output()
Returns the generated token.abstract String
outputArrayTipText()
Returns the tip text for this property.protected String
preExecute()
Resets the index.protected void
pruneBackup()
Removes entries from the backup.protected void
reset()
Resets the scheme.protected void
restoreState(Hashtable<String,Object> state)
Restores the state of the actor before the variables got updated.void
setOutputArray(boolean value)
Sets whether to output the items as array or as single strings.void
wrapUp()
Cleans up after the execution has finished.-
Methods inherited from class adams.flow.transformer.AbstractTransformer
currentInput, execute, hasInput, input, postExecute
-
Methods inherited from class adams.flow.core.AbstractActor
annotationsTipText, canInspectOptions, canPerformSetUpCheck, cleanUp, compareTo, configureLogger, destroy, doExecute, equals, finalUpdateVariables, findVariables, findVariables, forceVariables, forCommandLine, forName, forName, getAdditionalInformation, getAnnotations, getDefaultName, getDetectedVariables, getErrorHandler, getFlowActors, getFlowExecutionListeningSupporter, getFullName, getName, getNextSibling, getParent, getParentComponent, getPreviousSibling, getQuickInfo, getRoot, getScopeHandler, getSilent, getSkip, getStopFlowOnError, getStopMessage, getStorageHandler, getVariables, handleError, handleException, hasErrorHandler, hasStopMessage, index, initialize, isBackedUp, isExecuted, isExecuting, isFinished, isHeadless, isStopped, nameTipText, performSetUpChecks, performVariableChecks, pruneBackup, setAnnotations, setErrorHandler, setName, setParent, setSilent, setSkip, setStopFlowOnError, setUp, setVariables, shallowCopy, shallowCopy, silentTipText, sizeOf, skipTipText, stopExecution, stopExecution, stopFlowOnErrorTipText, updateDetectedVariables, updatePrefix, updateVariables, variableChanged
-
Methods inherited from class adams.core.option.AbstractOptionHandler
cleanUpOptions, finishInit, getDefaultLoggingLevel, getOptionManager, globalInfo, loggingLevelTipText, newOptionManager, setLoggingLevel, toCommandLine, toString
-
Methods inherited from class adams.core.logging.LoggingObject
getLogger, getLoggingLevel, initializeLogging, isLoggingEnabled
-
Methods inherited from class java.lang.Object
clone, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
-
Methods inherited from interface adams.flow.core.Actor
cleanUp, compareTo, destroy, equals, execute, findVariables, getAnnotations, getDefaultName, getDetectedVariables, getErrorHandler, getFlowExecutionListeningSupporter, getFullName, getName, getNextSibling, getParent, getParentComponent, getPreviousSibling, getQuickInfo, getRoot, getScopeHandler, getSilent, getSkip, getStopFlowOnError, getStopMessage, getStorageHandler, getVariables, handleError, hasErrorHandler, hasStopMessage, index, isExecuted, isFinished, isHeadless, isStopped, setAnnotations, setErrorHandler, setName, setParent, setSilent, setSkip, setStopFlowOnError, setUp, setVariables, shallowCopy, shallowCopy, sizeOf, stopExecution, stopExecution, toCommandLine, variableChanged
-
Methods inherited from interface adams.core.AdditionalInformationHandler
getAdditionalInformation
-
Methods inherited from interface adams.flow.core.InputConsumer
accepts
-
Methods inherited from interface adams.core.logging.LoggingLevelHandler
getLoggingLevel, setLoggingLevel
-
Methods inherited from interface adams.core.logging.LoggingSupporter
getLogger, isLoggingEnabled
-
Methods inherited from interface adams.core.option.OptionHandler
cleanUpOptions, getOptionManager
-
Methods inherited from interface adams.core.VariablesInspectionHandler
canInspectOptions
-
-
-
-
Field Detail
-
BACKUP_QUEUE
public static final String BACKUP_QUEUE
the key for storing the elements in the backup.- See Also:
- Constant Field Values
-
BACKUP_INDEX
public static final String BACKUP_INDEX
the key for storing the index in the backup.- See Also:
- Constant Field Values
-
m_Queue
protected ArrayList m_Queue
contains the items.
-
m_OutputArray
protected boolean m_OutputArray
whether to output an array instead of single items.
-
m_Index
protected int m_Index
the current index.
-
-
Method Detail
-
defineOptions
public void defineOptions()
Adds options to the internal list of options.- Specified by:
defineOptions
in interfaceOptionHandler
- Overrides:
defineOptions
in classAbstractActor
-
getItemClass
protected abstract Class getItemClass()
Returns the base class of the items.- Returns:
- the class
-
setOutputArray
public void setOutputArray(boolean value)
Sets whether to output the items as array or as single strings.- Specified by:
setOutputArray
in interfaceArrayProvider
- Specified by:
setOutputArray
in interfaceArrayProvider
- Parameters:
value
- true if output is an array
-
getOutputArray
public boolean getOutputArray()
Returns whether to output the items as array or as single strings.- Specified by:
getOutputArray
in interfaceArrayProvider
- Specified by:
getOutputArray
in interfaceArrayProvider
- Returns:
- true if output is an array
-
outputArrayTipText
public abstract String outputArrayTipText()
Returns the tip text for this property.- Specified by:
outputArrayTipText
in interfaceArrayProvider
- Specified by:
outputArrayTipText
in interfaceArrayProvider
- Returns:
- tip text for this property suitable for displaying in the GUI or for listing the options.
-
generates
public Class[] generates()
Returns the class of objects that it generates.- Specified by:
generates
in interfaceOutputProducer
- Returns:
- the classes
-
reset
protected void reset()
Resets the scheme.- Overrides:
reset
in classAbstractActor
-
pruneBackup
protected void pruneBackup()
Removes entries from the backup.- Overrides:
pruneBackup
in classAbstractActor
- See Also:
reset()
-
backupState
protected Hashtable<String,Object> backupState()
Backs up the current state of the actor before update the variables.- Overrides:
backupState
in classAbstractTransformer
- Returns:
- the backup
- See Also:
AbstractActor.updateVariables()
,AbstractActor.restoreState(Hashtable)
-
restoreState
protected void restoreState(Hashtable<String,Object> state)
Restores the state of the actor before the variables got updated.- Overrides:
restoreState
in classAbstractTransformer
- Parameters:
state
- the backup of the state to restore from- See Also:
AbstractActor.updateVariables()
,AbstractActor.backupState()
-
preExecute
protected String preExecute()
Resets the index.- Overrides:
preExecute
in classAbstractActor
- Returns:
- null if everything is fine, otherwise error message
- See Also:
m_Index
-
output
public Token output()
Returns the generated token.- Specified by:
output
in interfaceOutputProducer
- Overrides:
output
in classAbstractTransformer
- Returns:
- the generated token
-
hasPendingOutput
public boolean hasPendingOutput()
Checks whether there is pending output to be collected after executing the flow item.- Specified by:
hasPendingOutput
in interfaceOutputProducer
- Overrides:
hasPendingOutput
in classAbstractTransformer
- Returns:
- true if there is pending output
-
wrapUp
public void wrapUp()
Cleans up after the execution has finished.- Specified by:
wrapUp
in interfaceActor
- Overrides:
wrapUp
in classAbstractTransformer
-
-