Class IfStorageValue

  • All Implemented Interfaces:
    AdditionalInformationHandler, CleanUpHandler, Destroyable, GlobalInfoSupporter, LoggingLevelHandler, LoggingSupporter, OptionHandler, Pausable, QuickInfoSupporter, ShallowCopySupporter<Actor>, SizeOfHandler, Stoppable, StoppableWithFeedback, VariablesInspectionHandler, FlowPauseStateListener, VariableChangeListener, AtomicExecution, Actor, ActorHandler, ControlActor, ErrorHandler, Flushable, SubFlowWrapUp, Serializable, Comparable

    public class IfStorageValue
    extends AbstractDirectedControlActor
    An If-Then-Else source actor for storage values. If a storage value is available, the 'Then' branch gets executed, otherwise the 'Else' branch.
    Whereas the 'Then' branch receives the storage value (in case this branch accepts input), the 'Else' branch needs to produce its own data, i.e., having a source actor.

    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: IfStorageValue
     
    -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.
     
    -cache <java.lang.String> (property: cache)
        The name of the cache to retrieve the value from; uses the regular storage
        if left empty.
        default:
     
    -storage-name <adams.flow.control.StorageName> (property: storageName)
        The name of the stored value to retrieve.
        default: storage
     
    -then <adams.flow.core.Actor> (property: thenActor)
        The actor of the 'then' branch.
        default: adams.flow.control.Sequence -name then -actor adams.flow.sink.Null
     
    -else <adams.flow.core.Actor> (property: elseActor)
        The actor of the 'else' branch.
        default: adams.flow.control.Sequence -name else -actor adams.flow.source.StringConstants
     
    Author:
    fracpete (fracpete at waikato dot ac dot nz)
    See Also:
    Serialized Form
    • Field Detail

      • m_Cache

        protected String m_Cache
        the name of the LRU cache.
      • m_StorageName

        protected StorageName m_StorageName
        the name of the stored value.
      • m_ThenActor

        protected Actor m_ThenActor
        the actor to execute in the "then" branch.
      • m_ElseActor

        protected Actor m_ElseActor
        the actor to execute in the "else" branch.
    • Constructor Detail

      • IfStorageValue

        public IfStorageValue()
    • Method Detail

      • getDefaultThen

        protected Actor getDefaultThen()
        Returns the default 'Then' actor.
        Returns:
        the default actor
      • getDefaultElse

        protected Actor getDefaultElse()
        Returns the default 'Else' actor.
        Returns:
        the default actor
      • setCache

        public void setCache​(String value)
        Sets the name of the LRU cache to use, regular storage if left empty.
        Parameters:
        value - the cache
      • getCache

        public String getCache()
        Returns the name of the LRU cache to use, regular storage if left empty.
        Returns:
        the cache
      • cacheTipText

        public String cacheTipText()
        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.
      • setThenActor

        public void setThenActor​(Actor value)
        Sets the actor of the 'then' branch.
        Parameters:
        value - the actor
      • getThenActor

        public Actor getThenActor()
        Returns the actor of the 'then' branch.
        Returns:
        the actor
      • thenActorTipText

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

        public void setElseActor​(Actor value)
        Sets the actor of the 'else' branch.
        Parameters:
        value - the actor
      • getElseActor

        public Actor getElseActor()
        Returns the actor of the 'else' branch.
        Returns:
        the actor
      • elseActorTipText

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

        public Actor get​(int index)
        Returns the actor at the given position.
        Specified by:
        get in interface ActorHandler
        Specified by:
        get in class AbstractControlActor
        Parameters:
        index - the position
        Returns:
        the actor
      • set

        public String set​(int index,
                          Actor actor)
        Sets the actor at the given position.
        Specified by:
        set in interface ActorHandler
        Specified by:
        set in class AbstractControlActor
        Parameters:
        index - the position
        actor - the actor to set at this position
        Returns:
        null if everything is fine, otherwise the error
      • indexOf

        public int indexOf​(String actor)
        Returns the index of the actor.
        Specified by:
        indexOf in interface ActorHandler
        Specified by:
        indexOf in class AbstractControlActor
        Parameters:
        actor - the name of the actor to look for
        Returns:
        the index of -1 if not found