Class SetArrayElement

  • 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 SetArrayElement
    extends AbstractTransformer
    Sets an element of an array and forwards the updated array.

    Input/output:
    - accepts:
       adams.flow.core.Unknown
    - generates:
       adams.flow.core.Unknown


    Valid options are:

    -D <int> (property: debugLevel)
        The greater the number the more additional info the scheme may output to 
        the console (0 = off).
        default: 0
        minimum: 0
     
    -name <java.lang.String> (property: name)
        The name of the actor.
        default: SetArrayElement
     
    -annotation <adams.core.base.BaseText> (property: annotations)
        The annotations to attach to this actor.
        default: 
     
    -skip (property: skip)
        If set to true, transformation is skipped and the input token is just forwarded 
        as it is.
     
    -stop-flow-on-error (property: stopFlowOnError)
        If set to true, the flow gets stopped in case this actor encounters an error;
         useful for critical actors.
     
    -index <adams.core.Index> (property: index)
        The index of the element to set; An index is a number starting with 1; the 
        following placeholders can be used as well: first, second, third, last_2,
         last_1, last
        default: 1
     
    -origin <VALUE|STORAGE> (property: origin)
        Whether to use the provided 'value' or get the data from storage.
        default: VALUE
     
    -value <java.lang.String> (property: value)
        The value to set in the array (if origin is VALUE).
        default: 
     
    -storage-name <adams.flow.control.StorageName> (property: storageName)
        The name of the stored value to use (if origin is STORAGE).
        default: storage
     
    Version:
    $Revision$
    Author:
    fracpete (fracpete at waikato dot ac dot nz)
    See Also:
    Serialized Form
    • Field Detail

      • m_Index

        protected Index m_Index
        the index of the element to set.
      • m_Value

        protected String m_Value
        the value of the element to set.
      • m_StorageName

        protected StorageName m_StorageName
        the storage name.
    • Constructor Detail

      • SetArrayElement

        public SetArrayElement()
    • Method Detail

      • setIndex

        public void setIndex​(Index value)
        Sets the index (1-based).
        Parameters:
        value - the index
      • getIndex

        public Index getIndex()
        Returns the index (1-based).
        Returns:
        the index
      • indexTipText

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

        public void setOrigin​(SetArrayElement.Origin value)
        Sets whether to use the provided value or the value from storage.
        Parameters:
        value - the origin
      • getOrigin

        public SetArrayElement.Origin getOrigin()
        Returns whether to use the provided value or the value from storage.
        Returns:
        the origin
      • originTipText

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

        public void setValue​(String value)
        Sets the value to set in the array.
        Parameters:
        value - the value
      • getValue

        public String getValue()
        Returns the value to set in the array.
        Returns:
        the value
      • valueTipText

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

        public void setStorageName​(StorageName value)
        Sets the name of the stored value.
        Parameters:
        value - the name
      • getStorageName

        public StorageName getStorageName()
        Returns the name of the stored value.
        Returns:
        the name
      • storageNameTipText

        public String storageNameTipText()
        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:
        adams.flow.core.Unknown.class
      • generates

        public Class[] generates()
        Returns the class of objects that it generates.
        Returns:
        adams.flow.core.Unknown.class
      • doExecute

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