Class StringIndent

  • All Implemented Interfaces:
    AdditionalInformationHandler, CleanUpHandler, Destroyable, GlobalInfoSupporter, LoggingLevelHandler, LoggingSupporter, OptionHandler, QuickInfoSupporter, ShallowCopySupporter<Actor>, SizeOfHandler, Stoppable, StoppableWithFeedback, VariablesInspectionHandler, VariableChangeListener, Actor, ErrorHandler, InputConsumer, OutputProducer, Serializable, Comparable

    public class StringIndent
    extends AbstractStringOperation
    Indents the string with the specified character.
    Splits multi-line strings first and processes each line separately.

    Input/output:
    - accepts:
       java.lang.String
       java.lang.String[]
    - generates:
       java.lang.String
       java.lang.String[]


    -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 name of the actor.
        default: StringIndent
     
    -annotation <adams.core.base.BaseAnnotation> (property: annotations)
        The annotations to attach to this actor.
        default: 
     
    -skip <boolean> (property: skip)
        If set to true, transformation is skipped and the input token is just forwarded 
        as it is.
        default: false
     
    -stop-flow-on-error <boolean> (property: stopFlowOnError)
        If set to true, the flow gets stopped in case this actor encounters an error;
         useful for critical actors.
        default: false
     
    -silent <boolean> (property: silent)
        If enabled, then no errors are output in the console; Note: the enclosing 
        actor handler must have this enabled as well.
        default: false
     
    -indentation <java.lang.String> (property: indentation)
        The backquoted string to use for indentation; use '\t' for tab.
        default: 
     
    -num-times <int> (property: numTimes)
        The number of times to insert the indentation string.
        default: 1
        minimum: 0
     
    Author:
    fracpete (fracpete at waikato dot ac dot nz)
    See Also:
    Serialized Form
    • Field Detail

      • m_Indentation

        protected String m_Indentation
        the string to use for indentation.
      • m_NumTimes

        protected int m_NumTimes
        the number of times to indent each line.
    • Constructor Detail

      • StringIndent

        public StringIndent()
    • Method Detail

      • setIndentation

        public void setIndentation​(String value)
        Sets the backquoted string to use for indentation.
        Parameters:
        value - the indentation string
      • getIndentation

        public String getIndentation()
        Returns the backquoted string to use for indentation.
        Returns:
        the indentation string
      • indentationTipText

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

        public void setNumTimes​(int value)
        Sets the number of times to insert the indentation string.
        Parameters:
        value - the number of times
      • getNumTimes

        public int getNumTimes()
        Returns the number of times to insert the indentation string.
        Returns:
        the number of times
      • numTimesTipText

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

        protected String process​(String s,
                                 int index)
        Processes the string.
        Specified by:
        process in class AbstractStringOperation
        Parameters:
        s - the string to process
        index - the 0-based index of the string currently being processed
        Returns:
        the processed string or null if nothing produced