Class StringJoin

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

    public class StringJoin
    extends AbstractArrayProvider
    Creates a single string out of an array of strings.

    Input/output:
    - accepts:
       java.lang.String[]
    - generates:
       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: StringJoin
     
    -annotation <adams.core.base.BaseText> (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
     
    -output-array <boolean> (property: outputArray)
        If enabled, the strings are output as an array rather than one-by-one.
        default: false
     
    -glue <java.lang.String> (property: glue)
        The string to use for 'glueing' the array elements together; \t\n\r\b\f 
        get automatically converted into their character counterparts.
        default: 
     
    -max-length <int> (property: maxLength)
        The maximum length the joined string should not exceed; use -1 for unlimited 
        length.
        default: -1
        minimum: -1
     
    Version:
    $Revision$
    Author:
    fracpete (fracpete at waikato dot ac dot nz)
    See Also:
    Serialized Form
    • Field Detail

      • m_Glue

        protected String m_Glue
        the string to use for glueing the strings together.
      • m_MaxLength

        protected int m_MaxLength
        the maximum string length to allow.
    • Constructor Detail

      • StringJoin

        public StringJoin()
    • Method Detail

      • setGlue

        public void setGlue​(String value)
        Sets the string to use as 'glue' between the array elements.
        Parameters:
        value - the string
      • getGlue

        public String getGlue()
        Returns the string used as 'glue' between the array elements.
        Returns:
        the string
      • glueTipText

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

        public void setMaxLength​(int value)
        Sets the maximum length for the generated string(s).
        Parameters:
        value - the maximum length
      • getMaxLength

        public int getMaxLength()
        Returns the maximum length for the generated string(s).
        Returns:
        the maximum length
      • maxLengthTipText

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

        public Class[] accepts()
        Returns the class that the consumer accepts.
        Returns:
        java.lang.String[].class
      • doExecute

        protected String doExecute()
        Executes the flow item.
        Specified by:
        doExecute in class AbstractActor
        Returns:
        null if everything is fine, otherwise error message