Class StorageForLoop

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

    public class StorageForLoop
    extends AbstractForLoop
    implements VariableUpdater
    Emulates the following for-loop:
    - positive step size:
    for (int i = lower; i <= upper; i += step)
    - negative step size:
    for (int i = upper; i >= lower; i += step)
    In each iteration, the specified variable gets updated with the current value of the for-loop variable. The output of the for-loop is the specified storage value (in each iteration).

    Input/output:
    - 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: StorageForLoop
     
    -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.
     
    -lower <int> (property: loopLower)
        The lower bound of the loop (= the first value).
        default: 1
     
    -upper <int> (property: loopUpper)
        The upper bound of the loop.
        default: 10
     
    -step <int> (property: loopStep)
        The step size of the loop.
        default: 1
     
    -variable <adams.core.VariableName> (property: variableName)
        The variable that gets updated with the for-loop value.
        default: variable
     
    -storage <adams.flow.control.StorageName> (property: storageName)
        The name of the storage value to forward in each iteration of the loop.
        default: storage
     
    Author:
    fracpete (fracpete at waikato dot ac dot nz)
    See Also:
    Serialized Form
    • Field Detail

      • m_VariableName

        protected VariableName m_VariableName
        the variable to update with for-loop value.
      • m_StorageName

        protected StorageName m_StorageName
        the storage value to output.
    • Constructor Detail

      • StorageForLoop

        public StorageForLoop()
    • Method Detail

      • setVariableName

        public void setVariableName​(VariableName value)
        Sets the variable to update with the for-loop value.
        Parameters:
        value - the variable
      • getVariableName

        public VariableName getVariableName()
        Returns the variable to update with the for-loop value.
        Returns:
        the variable
      • variableNameTipText

        public String variableNameTipText()
        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 storage value to forward.
        Parameters:
        value - the storage name
      • getStorageName

        public StorageName getStorageName()
        Returns the name of the storage value to forward.
        Returns:
        the storage 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.
      • isUpdatingVariables

        public boolean isUpdatingVariables()
        Returns whether variables are being updated.
        Specified by:
        isUpdatingVariables in interface VariableUpdater
        Returns:
        true if variables are updated