Class SwitchComponent

  • All Implemented Interfaces:
    java.util.Map

    public class SwitchComponent
    extends BranchingComponent
    This class is used by an AssemblyLine
    • Constructor Detail

      • SwitchComponent

        public SwitchComponent​(AssemblyLine parent,
                               java.lang.String name,
                               BranchingConfig config)
                        throws java.lang.Exception
        Constructor for the BranchingComponent object
        Parameters:
        parent - The AssemblyLine that contains this SwitchComponent
        name - The name of this SwitchComponent
        config - The configuration for this SwitchComponent
        Throws:
        java.lang.Exception
    • Method Detail

      • initialize

        public void initialize()
                        throws java.lang.Exception
        Initializes this SwitchComponent
        Overrides:
        initialize in class BranchingComponent
        Throws:
        java.lang.Exception - Not really, but subclasses may throw Exceptions
      • getType

        public int getType()
        Gets the type attribute of the BranchingComponent object
        Overrides:
        getType in class BranchingComponent
        Returns:
        The type value
      • willExecute

        public boolean willExecute​(Entry work)
                            throws java.lang.Exception
        Return true/false if this component should be executed. Return true if this is a SWITCH, or if the expression in this CASE matches the expression in the containing SWITCH
        Overrides:
        willExecute in class BranchingComponent
        Parameters:
        work - The work Entry
        Returns:
        see above
        Throws:
        java.lang.Exception - Any Exception that might be thrown
      • add

        public void add​(Entry meta)
                 throws java.lang.Exception
        This method does nothing
        Overrides:
        add in class BranchingComponent
        Parameters:
        meta - parameter
        Throws:
        java.lang.Exception - if problem occurs
      • getLastExpression

        public java.lang.String getLastExpression()
        Returns the value from the last evaluated expression. This is used by the CASE components when they compare to their own values.
      • getParentSwitch

        public SwitchComponent getParentSwitch()
        Returns the SWITCH component to which this CASE belongs.
      • getCaseExecuted

        public boolean getCaseExecuted()
        Returns true if any contained CASE component executed this cycle
        Returns:
        true if any contained CASE component executed this cycle
      • getCaseExecutedBy

        public java.lang.String getCaseExecutedBy()
        Returns the name of the CASE component that executed this cycle
        Returns:
        the name of the CASE component that executed this cycle
      • setCaseExecutedBy

        public void setCaseExecutedBy​(java.lang.String name)
        Sets the name of the CASE component that executed this cycle (called by CASE components)
        Parameters:
        name - The name of the CASE component that executed this cycle