Class VariablesArray

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

    public class VariablesArray
    extends AbstractSource
    implements VariableUser
    Outputs the values associated with the specified variable names as a string array.

    Input/output:
    - 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: VariablesArray
     
    -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 execution at this level gets stopped in case this 
        actor encounters an error; the error gets propagated; 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
     
    -var-name <adams.core.VariableName> [-var-name ...] (property: variableNames)
        The names of the variables to retrieve as array.
        default: 
     
    -conversion <adams.data.conversion.Conversion> (property: conversion)
        The type of conversion to perform.
        default: adams.data.conversion.StringToString
     
    Author:
    fracpete (fracpete at waikato dot ac dot nz)
    See Also:
    Serialized Form
    • Field Detail

      • m_VariableNames

        protected VariableName[] m_VariableNames
        the names of the stored values.
      • m_StoredValue

        protected Object m_StoredValue
        the stored value.
      • m_Conversion

        protected Conversion m_Conversion
        the type of conversion.
    • Constructor Detail

      • VariablesArray

        public VariablesArray()
        Default constructor.
      • VariablesArray

        public VariablesArray​(VariableName[] variableNames)
        Initializes with the specified names.
        Parameters:
        variableNames - the names to use
      • VariablesArray

        public VariablesArray​(String[] variableNames)
        Initializes with the specified names.
        Parameters:
        variableNames - the names to use
    • Method Detail

      • addVariableName

        public void addVariableName​(VariableName value)
        Adds the variable.
        Parameters:
        value - the names
      • setVariableNames

        public void setVariableNames​(String[] value)
        Sets the names of the variables.
        Parameters:
        value - the names
      • setVariableNames

        public void setVariableNames​(VariableName[] value)
        Sets the names of the variables.
        Parameters:
        value - the names
      • getVariableNames

        public VariableName[] getVariableNames()
        Returns the names of the variables.
        Returns:
        the names
      • variableNamesTipText

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

        public void setConversion​(Conversion value)
        Sets the type of conversion to perform.
        Parameters:
        value - the type of conversion
      • getConversion

        public Conversion getConversion()
        Returns the type of conversion to perform.
        Returns:
        the type of conversion
      • conversionTipText

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

        public boolean isUsingVariables()
        Returns whether variables are being used.
        Specified by:
        isUsingVariables in interface VariableUser
        Returns:
        true if variables are used
      • generates

        public Class[] generates()
        Returns the class of objects that it generates.
        Specified by:
        generates in interface OutputProducer
        Returns:
        java.lang.String[].class
      • reset

        protected void reset()
        Resets the scheme.
        Overrides:
        reset in class AbstractActor
      • doExecute

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

        public Token output()
        Returns the generated token.
        Specified by:
        output in interface OutputProducer
        Returns:
        the generated token
      • hasPendingOutput

        public boolean hasPendingOutput()
        Checks whether there is pending output to be collected after executing the flow item.
        Specified by:
        hasPendingOutput in interface OutputProducer
        Returns:
        true if there is pending output