Class StringSplit

  • 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 StringSplit
    extends AbstractTransformer
    Splits a string using a regular expression.

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


    Valid options are:

    -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: StringSplit
     
    -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
     
    -expression <java.lang.String> (property: expression)
        The regular expression used for splitting the string; \t\n\r\b\f get automatically 
        converted into their character counterparts.
        default: \\t
     
    -delimiter <DISCARD|APPEND|PREPEND> (property: delimiter)
        Defines what to do with the delimiters (= expression).
        default: DISCARD
     
    Version:
    $Revision$
    Author:
    fracpete (fracpete at waikato dot ac dot nz)
    See Also:
    Serialized Form
    • Field Detail

      • m_Expression

        protected BaseRegExp m_Expression
        the regular expression to use for splitting the string.
    • Constructor Detail

      • StringSplit

        public StringSplit()
    • Method Detail

      • setExpression

        public void setExpression​(String value)
        Sets the regular expression used for splitting the string.
        Parameters:
        value - the expression
      • getExpression

        public String getExpression()
        Returns the regular expression for splitting the string.
        Returns:
        the expression
      • expressionTipText

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

        public void setDelimiter​(StringSplit.Delimiter value)
        Sets what to do with the delimiter (= expression).
        Parameters:
        value - the action
      • getDelimiter

        public StringSplit.Delimiter getDelimiter()
        Returns what to do with the delimiter (= expression).
        Returns:
        the action
      • delimiterTipText

        public String delimiterTipText()
        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
      • generates

        public Class[] generates()
        Returns the class of objects that it generates.
        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