Package adams.flow.transformer
Class AbstractTransformer
- java.lang.Object
-
- adams.core.logging.LoggingObject
-
- adams.core.logging.CustomLoggingLevelObject
-
- adams.core.option.AbstractOptionHandler
-
- adams.flow.core.AbstractActor
-
- adams.flow.transformer.AbstractTransformer
-
- All Implemented Interfaces:
AdditionalInformationHandler,CleanUpHandler,Destroyable,GlobalInfoSupporter,LoggingLevelHandler,LoggingSupporter,OptionHandler,QuickInfoSupporter,ShallowCopySupporter<Actor>,SizeOfHandler,Stoppable,StoppableWithFeedback,VariablesInspectionHandler,VariableChangeListener,Actor,ErrorHandler,InputConsumer,OutputProducer,Serializable,Comparable
- Direct Known Subclasses:
AbstractArrayProvider,AbstractCallableWekaClustererEvaluator,AbstractContainerValueExtractor,AbstractDataContainerAdd,AbstractDataContainerAppend,AbstractDataContainerFileReader,AbstractDataContainerFileWriter,AbstractDataContainerTransformer,AbstractDataProcessor,AbstractDbTransformer,AbstractDeleteReportValue,AbstractDeleteReportValueByExpression,AbstractGetReportValue,AbstractInstanceGenerator,AbstractInteractiveTransformer,AbstractInteractiveTransformerDialog,AbstractMultiCompress,AbstractMultiDecompress,AbstractProcessWekaInstanceWithModel,AbstractReportDbUpdater,AbstractReportFileWriter,AbstractScript,AbstractSetReportValue,AbstractSingleCompress,AbstractSingleDecompress,AbstractSpreadSheetTransformer,AbstractStringOperation,AbstractTransformerWithPropertiesUpdating,AbstractWekaClassifierEvaluator,AbstractWekaModelReader,AbstractWekaPredictionsTransformer,AddDOMAttribute,AddDOMNode,AddNote,AppendArchive,AppendName,ArrayCombinations,ArrayLength,ArrayReverse,ArrayStatistic,ArraySubset,ArraySubsetGeneration,ArrayToChunks,ArrayToCollection,ArrayToSequence,ArrayToVariables,BaseName,BinaryFileReader,Block,BoofCVDetectLines,BoofCVDetectLineSegments,BoofCVFeatureGenerator,Breakpoint,BufferedImageFeatureGenerator,Cast,ChangeImageObjectPrefix,ChangeReportFieldPrefixes,ClassSelector,CollectionAppend,CollectionInsert,CollectionSize,CollectionSubset,CollectionToArray,CollectionToSequence,ColorProvider,CompareObjects,CompareObjectTypes,ConfusionMatrix,Convert,ConvertFeatures,Copy,CopyFile,CopyToClipboard,CounterAdd,CounterInit,CountObjectsInPolygon,CountObjectsInRegion,CreateEmail,DatasetFilter,DatasetRowFilter,DateTimeTypeDifference,DecodeBarcode,DeleteFile,DeleteJsonValue,DeleteMapValue,DeleteOverlappingImageObjects,DeletePropertyValue,DeleteStorageValue,DeleteVariable,Deserialize,DetermineOverlappingAreas,DetermineOverlappingObjects,Diff,DirName,DownloadContent,Draw,EncodeBarcode,ExecuteActor,ExecuteJobs,ExecuteRemoteCommand,ExifTagOperation,ExtractGroup,ExtractID,FileChanged,FileExtension,FileInfo,FilenameGenerator,FileTailer,FilterMap,FindInFile,FlowFileReader,ForceFlush,GC,GenerateFileBasedDataset,GetArrayElement,GetDatabaseID,GetID,GetImageObjectMetaData,GetListElement,GetMapValue,GetNotes,GetObjectProperty,GetProperty,GetRemoteCommandPayload,GetReport,GetStorageValue,HashSetAdd,HashSetInit,HashSetRemove,HeapDump,HexReplace,HttpPostFile,HttpRequest,IDGenerator,ImageFileReader,ImageInfo,ImageMetaData,ImageObjectFilter,ImageObjectIndexOffset,ImageObjectInfo,ImageObjectOverlap,ImageObjectOverlapMatrix,ImageObjectToVariables,ImagePreparation,ImageSegmentationContainerFilter,ImageSegmentationContainerOperation,ImageSegmentationFileReader,ImageSharpness,IMAPOperation,IncStorageValue,IncVariable,IndexedSplitsRunsEvaluation,IndexedSplitsRunsGenerator,IndexedSplitsRunsPredictions,IndexedSplitsRunsReader,Injector,IntersectOverUnion,JDeps,JsonFileReader,LookUp,LookUpAdd,LookUpRemove,MakeDir,MakeForecastPlotContainer,MakeJFreeChartDataset,MakeLogEntry,MakePlotContainer,MakeXChartDataset,MapToStorageValues,MapToVariables,MapVariableIterator,Mat5ArraySubset,Mat5FileAddArray,Mat5FileAddMap,Mat5FileGetArray,Mat5FileReader,Mat5GetMatrixElement,Mat5GetStructField,Mat5SetMatrixElement,Mat5SetStructField,MathExpression,Max,MergeObjectLocations,MergeReport,MergeReportFromMap,MessageDigest,MimeType,Min,MoveFile,MultiMapOperation,MultiSpreadSheetOperation,NegativeRegions,ObjectArrayToPrimitiveArray,OpenCVFeatureGenerator,OptionProducer,OutlierDetector,PassThrough,PDFAppendDocument,PDFCreate,PDFExtract,PDFExtractImages,PDFExtractText,PDFGenerate,PDFMerge,PDFMetaData,PDFPageCount,PDFRenderPages,PDFStamp,PlotProcessor,PredictionEccentricity,PrependDir,PrimitiveArrayToObjectArray,ProgrammaticTokenListener,PropertiesFileReader,PropertiesToVariables,PythonExpandScript,RaiseError,RelativeDir,RemoteCommandReader,RemoveImageObject,RemoveOverlappingImageObjects,ReportMathExpression,ReportToStorage,ReportToVariables,Round,SaveEmailAttachments,ScaleReportObjects,ScpFrom,ScpTo,SequenceToArray,SequenceToCollection,SetArrayElement,SetContainerValue,SetDatabaseID,SetID,SetImageObjectMetaData,SetJsonValue,SetManyVariables,SetMapValue,SetPlotContainerValue,SetPropertyValue,SetReportFromFile,SetReportFromSource,SetStorageFlag,SetStorageValue,SetSystemProperty,SetVariable,SFTPDelete,SFTPGet,SFTPSend,Sleep,SMBGet,SMBSend,Sort,SplitFile,SpreadSheetCommonIDs,SpreadSheetDifference,SpreadSheetGetColumnIndex,SpreadSheetGetHeaderCell,SpreadSheetMerge,SpreadSheetMethodMerge,SpreadSheetRowBuffer,SpreadSheetStorageRowIterator,SpreadSheetVariableRowIterator,StorageCollectionInsert,StorageJFreeChartAddSeries,StorageXChartAddDataset,StringExpression,StringIndexOf,StringLength,StringSplit,SubStringCount,SwapVariables,TesseractOCR,TextFileReader,TextRenderer,TimeseriesFeatureGenerator,TimeseriesInfo,Timestamp,Tool,Touch,TriggerEvent,UniqueID,UpdateGroup,UpdateID,WaitForFile,WekaAccumulatedError,WekaAggregateEvaluations,WekaAttributeSelection,WekaAttributeSelectionSummary,WekaBootstrapping,WekaClassifierInfo,WekaClassifierOptimizer,WekaClassifierRanker,WekaClassifierSetupProcessor,WekaClassSelector,WekaClusterAssignments,WekaClustererInfo,WekaClustererPostProcessor,WekaClusterEvaluationSummary,WekaCrossValidationSplit,WekaDatasetsMerge,WekaDatasetSplit,WekaEnsembleGenerator,WekaEvaluationInfo,WekaEvaluationSummary,WekaEvaluationValuePicker,WekaEvaluationValues,WekaExperiment,WekaExperimentEvaluation,WekaExperimentExecution,WekaExperimentFileReader,WekaExtractArray,WekaExtractPLSMatrix,WekaFileReader,WekaGenericPLSMatrixAccess,WekaGeneticAlgorithmInitializer,WekaGetCapabilities,WekaGetInstancesValue,WekaGetInstanceValue,WekaInstanceBuffer,WekaInstanceDumper,WekaInstanceEvaluator,WekaInstancesAppend,WekaInstancesMerge,WekaInstancesStatistic,WekaInstanceStreamPlotGenerator,WekaMultiLabelSplitter,WekaNearestNeighborSearch,WekaNewInstance,WekaPackageManagerAction,WekaPrimeForecaster,WekaPrincipalComponents,WekaRegexToRange,WekaRelationName,WekaRenameRelation,WekaReorderAttributesToReference,WekaRepeatedCrossValidationOutput,WekaSetInstancesValue,WekaSetInstanceValue,WekaSpreadSheetToPredictions,WekaStoreInstance,WekaSubsets,WekaTestSetClustererEvaluator,WekaTextDirectoryReader,WekaTrainAssociator,WekaTrainClassifier,WekaTrainClusterer,WekaTrainForecaster,XMLFileReader,XPath,XSLT,YamlFileReader
public abstract class AbstractTransformer extends AbstractActor implements InputConsumer, OutputProducer
Ancestor for all flow items that process an input token and generate an output token.- Author:
- fracpete (fracpete at waikato dot ac dot nz)
- See Also:
- Serialized Form
-
-
Field Summary
Fields Modifier and Type Field Description static StringBACKUP_INPUTthe key for storing the input token in the backup.static StringBACKUP_OUTPUTthe key for storing the output token in the backup.protected Tokenm_InputTokenthe current input token.protected Tokenm_OutputTokenthe current output token.-
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 AbstractTransformer()
-
Method Summary
All Methods Instance 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.TokencurrentInput()Returns the current input token, if any.Stringexecute()Executes the flow item.booleanhasInput()Returns whether an input token is currently present.booleanhasPendingOutput()Checks whether there is pending output to be collected after executing the flow item.voidinput(Token token)The method that accepts the input token and then processes it.Tokenoutput()Returns the generated token.protected StringpostExecute()Post-execute hook.protected voidrestoreState(Hashtable<String,Object> state)Restores the state of the actor before the variables got updated.voidwrapUp()Cleans up after the execution has finished.-
Methods inherited from class adams.flow.core.AbstractActor
annotationsTipText, canInspectOptions, canPerformSetUpCheck, cleanUp, compareTo, configureLogger, defineOptions, 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, preExecute, pruneBackup, pruneBackup, reset, 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, 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, defineOptions, getOptionManager
-
Methods inherited from interface adams.flow.core.OutputProducer
generates
-
Methods inherited from interface adams.core.VariablesInspectionHandler
canInspectOptions
-
-
-
-
Field Detail
-
BACKUP_INPUT
public static final String BACKUP_INPUT
the key for storing the input token in the backup.- See Also:
- Constant Field Values
-
BACKUP_OUTPUT
public static final String BACKUP_OUTPUT
the key for storing the output token in the backup.- See Also:
- Constant Field Values
-
m_InputToken
protected transient Token m_InputToken
the current input token.
-
m_OutputToken
protected transient Token m_OutputToken
the current output token.
-
-
Method Detail
-
backupState
protected Hashtable<String,Object> backupState()
Backs up the current state of the actor before update the variables.- Overrides:
backupStatein classAbstractActor- 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:
restoreStatein classAbstractActor- Parameters:
state- the backup of the state to restore from- See Also:
AbstractActor.updateVariables(),AbstractActor.backupState()
-
input
public void input(Token token)
The method that accepts the input token and then processes it.- Specified by:
inputin interfaceInputConsumer- Parameters:
token- the token to accept and process- See Also:
m_InputToken
-
hasInput
public boolean hasInput()
Returns whether an input token is currently present.- Specified by:
hasInputin interfaceInputConsumer- Returns:
- true if input token present
-
currentInput
public Token currentInput()
Returns the current input token, if any.- Specified by:
currentInputin interfaceInputConsumer- Returns:
- the input token, null if none present
-
postExecute
protected String postExecute()
Post-execute hook.- Overrides:
postExecutein classAbstractActor- Returns:
- null if everything is fine, otherwise error message
- See Also:
AbstractActor.m_Executed
-
execute
public String execute()
Executes the flow item.- Specified by:
executein interfaceActor- Overrides:
executein classAbstractActor- Returns:
- null if everything is fine, otherwise error message
-
hasPendingOutput
public boolean hasPendingOutput()
Checks whether there is pending output to be collected after executing the flow item.- Specified by:
hasPendingOutputin interfaceOutputProducer- Returns:
- true if there is pending output
-
output
public Token output()
Returns the generated token.- Specified by:
outputin interfaceOutputProducer- Returns:
- the generated token
-
wrapUp
public void wrapUp()
Cleans up after the execution has finished.- Specified by:
wrapUpin interfaceActor- Overrides:
wrapUpin classAbstractActor
-
-