Class IterateFilesWithProgressBar

  • All Implemented Interfaces:
    Destroyable, GlobalInfoSupporter, LoggingLevelHandler, LoggingSupporter, OptionHandler, ShallowCopySupporter<AbstractActorTemplate>, SizeOfHandler, Serializable

    public class IterateFilesWithProgressBar
    extends AbstractActorTemplate
    Generates a sub-flow that looks for files in a directory and then iterates those. The progress is displayed using a ProgressBar.

    -logging-level <OFF|SEVERE|WARNING|INFO|CONFIG|FINE|FINER|FINEST> (property: loggingLevel)
        The logging level for outputting errors and debugging output.
        default: WARNING
     
    -name <java.lang.String> (property: name)
        The new name for the actor; leave empty to use current.
        default: process
     
    -dir <adams.core.io.PlaceholderDirectory> (property: dir)
        The directory to search for files matching the regular expression.
        default: ${CWD}
     
    -regexp <adams.core.base.BaseRegExp> (property: regExp)
        The regular expression that the files must match.
        default: .*
        more: https://docs.oracle.com/javase/tutorial/essential/regex/
        https://docs.oracle.com/javase/8/docs/api/java/util/regex/Pattern.html
     
    -recursive <boolean> (property: recursive)
        If enabled, the file search is performed recursively.
        default: false
     
    -select-subset <boolean> (property: selectSubset)
        If enabled, the user can select a subset of the files.
        default: false
     
    -num-files <adams.core.VariableName> (property: numFiles)
        The name of the variable to use for storing the total number of files located.
        default: num_files
     
    -file-counter <adams.core.VariableName> (property: fileCounter)
        The name of the variable to use for storing the current count of files iterated.
        default: file_counter
     
    -unfold-file-array <boolean> (property: unfoldFileArray)
        If enabled, the file array gets flattened using the adams.flow.transformer.ArrayToSequence
        transformer instead of processing files within the adams.flow.control.ArrayProcess
        control actor.
        default: true
     
    Author:
    fracpete (fracpete at waikato dot ac dot nz)
    See Also:
    Serialized Form
    • Field Detail

      • m_RegExp

        protected BaseRegExp m_RegExp
        the regular expression to apply.
      • m_Recursive

        protected boolean m_Recursive
        whether to search recursively.
      • m_SelectSubset

        protected boolean m_SelectSubset
        whether to let the user select a subset.
      • m_NumFiles

        protected VariableName m_NumFiles
        the number of files variable.
      • m_FileCounter

        protected VariableName m_FileCounter
        the counter variable.
      • m_UnfoldFileArray

        protected boolean m_UnfoldFileArray
        whether to unfold the array (ArrayToSequence) or not (ArrayProcess).
    • Constructor Detail

      • IterateFilesWithProgressBar

        public IterateFilesWithProgressBar()
    • Method Detail

      • setDir

        public void setDir​(PlaceholderDirectory value)
        Sets the directory to search for files.
        Parameters:
        value - the directory
      • getDir

        public PlaceholderDirectory getDir()
        Returns the directory to search for files.
        Returns:
        the directory
      • dirTipText

        public String dirTipText()
        Returns the tip text for this property.
        Returns:
        tip text for this property suitable for displaying in the GUI or for listing the options.
      • setRegExp

        public void setRegExp​(BaseRegExp value)
        Sets the regular expressions that the files must match.
        Parameters:
        value - the expression
      • getRegExp

        public BaseRegExp getRegExp()
        Returns the regular expression that the files must match.
        Returns:
        the expression
      • regExpTipText

        public String regExpTipText()
        Returns the tip text for this property.
        Returns:
        tip text for this property suitable for displaying in the GUI or for listing the options.
      • setSelectSubset

        public void setSelectSubset​(boolean value)
        Sets whether to let the user select a subset.
        Parameters:
        value - true if user can select
      • getSelectSubset

        public boolean getSelectSubset()
        Returns whether to let the user select a subset.
        Returns:
        true if user can select
      • selectSubsetTipText

        public String selectSubsetTipText()
        Returns the tip text for this property.
        Returns:
        tip text for this property suitable for displaying in the GUI or for listing the options.
      • setRecursive

        public void setRecursive​(boolean value)
        Sets whether to search for files recursively.
        Parameters:
        value - true if recursive
      • getRecursive

        public boolean getRecursive()
        Returns whether to search for files recursively.
        Returns:
        true if recursive
      • recursiveTipText

        public String recursiveTipText()
        Returns the tip text for this property.
        Returns:
        tip text for this property suitable for displaying in the GUI or for listing the options.
      • setNumFiles

        public void setNumFiles​(VariableName value)
        Sets the variable name to use for the total number of files found.
        Parameters:
        value - the variable name
      • getNumFiles

        public VariableName getNumFiles()
        Returns the variable name to use for the total number of files found.
        Returns:
        the variable name
      • numFilesTipText

        public String numFilesTipText()
        Returns the tip text for this property.
        Returns:
        tip text for this property suitable for displaying in the GUI or for listing the options.
      • setFileCounter

        public void setFileCounter​(VariableName value)
        Sets the variable name to use for storing the current count of files iterated.
        Parameters:
        value - the variable name
      • getFileCounter

        public VariableName getFileCounter()
        Returns the variable name to use for storing the current count of files iterated.
        Returns:
        the variable name
      • fileCounterTipText

        public String fileCounterTipText()
        Returns the tip text for this property.
        Returns:
        tip text for this property suitable for displaying in the GUI or for listing the options.
      • setUnfoldFileArray

        public void setUnfoldFileArray​(boolean value)
        Sets whether to flatten the file array.
        Parameters:
        value - true if to unfold
      • getUnfoldFileArray

        public boolean getUnfoldFileArray()
        Returns whether to flatten the file array.
        Returns:
        true if to unfold
      • unfoldFileArrayTipText

        public String unfoldFileArrayTipText()
        Returns the tip text for this property.
        Returns:
        tip text for this property suitable for displaying in the GUI or for listing the options.
      • isInteractive

        public boolean isInteractive()
        Whether the flow generated is an interactive one.
        Specified by:
        isInteractive in class AbstractActorTemplate
        Returns:
        true if interactive