Package adams.flow.transformer
Class AbstractArraySplitter
- 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.AbstractArraySplitter
-
- All Implemented Interfaces:
adams.core.AdditionalInformationHandler
,adams.core.CleanUpHandler
,adams.core.DeepCopyOperator
,adams.core.Destroyable
,adams.core.GlobalInfoSupporter
,adams.core.logging.LoggingLevelHandler
,adams.core.logging.LoggingSupporter
,adams.core.option.OptionHandler
,adams.core.QuickInfoSupporter
,adams.core.ShallowCopySupporter<adams.flow.core.Actor>
,adams.core.SizeOfHandler
,adams.core.Stoppable
,adams.core.StoppableWithFeedback
,adams.core.VariablesInspectionHandler
,adams.event.VariableChangeListener
,adams.flow.core.Actor
,adams.flow.core.ErrorHandler
,adams.flow.core.InputConsumer
,adams.flow.core.OutputProducer
,Serializable
,Comparable
- Direct Known Subclasses:
ArrayFolds
,ArraySubSample
public abstract class AbstractArraySplitter extends adams.flow.transformer.AbstractTransformer implements adams.core.DeepCopyOperator
Ancestor for array splitters.- Author:
- fracpete (fracpete at waikato dot ac dot nz)
- See Also:
- Serialized Form
-
-
Field Summary
Fields Modifier and Type Field Description protected boolean
m_DeepCopy
whether to perform a deep copy of the elements.protected adams.data.random.RandomIntegerRangeGenerator
m_Generator
the random number generator.protected adams.data.SplitResultType
m_SplitResult
the type of data to return.-
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
-
-
Constructor Summary
Constructors Constructor Description AbstractArraySplitter()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description Class[]
accepts()
Returns the class that the consumer accepts.String
deepCopyTipText()
Returns the tip text for this property.void
defineOptions()
Adds options to the internal list of options.Class[]
generates()
Returns the class of objects that it generates.String
generatorTipText()
Returns the tip text for this property.boolean
getDeepCopy()
Returns whether to perform a deep copy of each array element before transferring it into the target array.adams.data.random.RandomIntegerRangeGenerator
getGenerator()
Returns the random number generator.String
getQuickInfo()
Returns a quick info about the actor, which will be displayed in the GUI.adams.data.SplitResultType
getSplitResult()
Returns what type of the split to return, e.g., sample or inverse of sample.protected Object
newArray(Object arrayOld, gnu.trove.list.array.TIntArrayList indices, String log)
Creates a new array from the old and the given indices.void
setDeepCopy(boolean value)
Sets whether to perform a deep copy of each array element before transferring it into the target array.void
setGenerator(adams.data.random.RandomIntegerRangeGenerator value)
Sets the random number generator.void
setSplitResult(adams.data.SplitResultType value)
Sets what type of the split to return, e.g., sample or inverse of sample.String
splitResultTipText()
Returns the tip text for this property.-
Methods inherited from class adams.flow.transformer.AbstractTransformer
backupState, currentInput, execute, hasInput, hasPendingOutput, input, output, postExecute, restoreState, wrapUp
-
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, 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, 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
-
-
-
-
Field Detail
-
m_Generator
protected adams.data.random.RandomIntegerRangeGenerator m_Generator
the random number generator.
-
m_SplitResult
protected adams.data.SplitResultType m_SplitResult
the type of data to return.
-
m_DeepCopy
protected boolean m_DeepCopy
whether to perform a deep copy of the elements.
-
-
Method Detail
-
defineOptions
public void defineOptions()
Adds options to the internal list of options.- Specified by:
defineOptions
in interfaceadams.core.option.OptionHandler
- Overrides:
defineOptions
in classadams.flow.core.AbstractActor
-
setGenerator
public void setGenerator(adams.data.random.RandomIntegerRangeGenerator value)
Sets the random number generator.- Parameters:
value
- the generator
-
getGenerator
public adams.data.random.RandomIntegerRangeGenerator getGenerator()
Returns the random number generator.- Returns:
- the generator
-
generatorTipText
public String generatorTipText()
Returns the tip text for this property.- Returns:
- tip text for this property suitable for displaying in the GUI or for listing the options.
-
setSplitResult
public void setSplitResult(adams.data.SplitResultType value)
Sets what type of the split to return, e.g., sample or inverse of sample.- Parameters:
value
- the type
-
getSplitResult
public adams.data.SplitResultType getSplitResult()
Returns what type of the split to return, e.g., sample or inverse of sample.- Returns:
- the type
-
splitResultTipText
public String splitResultTipText()
Returns the tip text for this property.- Returns:
- tip text for this property suitable for displaying in the GUI or for listing the options.
-
setDeepCopy
public void setDeepCopy(boolean value)
Sets whether to perform a deep copy of each array element before transferring it into the target array.- Specified by:
setDeepCopy
in interfaceadams.core.DeepCopyOperator
- Parameters:
value
- true if to copy
-
getDeepCopy
public boolean getDeepCopy()
Returns whether to perform a deep copy of each array element before transferring it into the target array.- Specified by:
getDeepCopy
in interfaceadams.core.DeepCopyOperator
- Returns:
- true if to copy
-
deepCopyTipText
public String deepCopyTipText()
Returns the tip text for this property.- Specified by:
deepCopyTipText
in interfaceadams.core.DeepCopyOperator
- Returns:
- tip text for this property suitable for displaying in the GUI or for listing the options.
-
getQuickInfo
public String getQuickInfo()
Returns a quick info about the actor, which will be displayed in the GUI.- Specified by:
getQuickInfo
in interfaceadams.flow.core.Actor
- Specified by:
getQuickInfo
in interfaceadams.core.QuickInfoSupporter
- Overrides:
getQuickInfo
in classadams.flow.core.AbstractActor
- Returns:
- null if no info available, otherwise short string
-
accepts
public Class[] accepts()
Returns the class that the consumer accepts.- Specified by:
accepts
in interfaceadams.flow.core.InputConsumer
- Returns:
- the classes
-
generates
public Class[] generates()
Returns the class of objects that it generates.- Specified by:
generates
in interfaceadams.flow.core.OutputProducer
- Returns:
- the classes
-
newArray
protected Object newArray(Object arrayOld, gnu.trove.list.array.TIntArrayList indices, String log)
Creates a new array from the old and the given indices.- Parameters:
arrayOld
- the old arrayindices
- the indices to grab from the old arraylog
- the info for the logger- Returns:
- the new array
-
-