Class 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
      • 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
    • 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 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
      • Methods inherited from interface adams.core.AdditionalInformationHandler

        getAdditionalInformation
      • 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

      • 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.
    • Constructor Detail

      • AbstractArraySplitter

        public AbstractArraySplitter()
    • Method Detail

      • defineOptions

        public void defineOptions()
        Adds options to the internal list of options.
        Specified by:
        defineOptions in interface adams.core.option.OptionHandler
        Overrides:
        defineOptions in class adams.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 interface adams.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 interface adams.core.DeepCopyOperator
        Returns:
        true if to copy
      • deepCopyTipText

        public String deepCopyTipText()
        Returns the tip text for this property.
        Specified by:
        deepCopyTipText in interface adams.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 interface adams.flow.core.Actor
        Specified by:
        getQuickInfo in interface adams.core.QuickInfoSupporter
        Overrides:
        getQuickInfo in class adams.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 interface adams.flow.core.InputConsumer
        Returns:
        the classes
      • generates

        public Class[] generates()
        Returns the class of objects that it generates.
        Specified by:
        generates in interface adams.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 array
        indices - the indices to grab from the old array
        log - the info for the logger
        Returns:
        the new array