Module PauWareTwo

Class AbstractState

java.lang.Object
com.pauware.pauware_engine.Core.AbstractState
Direct Known Subclasses:
AbstractStateMachine, State

public abstract class AbstractState
extends java.lang.Object
This abstract class represents the general notion of State in UML. Use of this class occurs through the following subclass: State. Since UML State Machine Diagrams are nested, an instance of this class may be a leaf state or a state containing substates.

Compatibility: Java 9.

Since:
1.0
  • Nested Class Summary

    Nested Classes
    Modifier and Type Class Description
    protected static class  AbstractState._Cross_over
    For visualization purposes only, private use
  • Field Summary

    Fields
    Modifier and Type Field Description
    protected boolean _active
    This field records if a state is active.
    protected java.util.Map<java.lang.String,​java.util.Map<AbstractGuard,​java.util.Vector<AbstractAction>>> _allowed_events
    This field records the allowed events of a state with their possible associated guards and their respective associated actions.
    protected static java.lang.String _AND  
    protected AbstractAction _do
    This field records the activity, if any, associated with a state.
    protected java.util.Vector<AbstractAction> _entry
    This field records the action(s), if any, associated with a state when entering it.
    protected java.util.Vector<AbstractAction> _exit
    This field records the action(s), if any, associated with a state when exiting it.
    protected boolean _inputState
    This field records if a state is an input state.
    protected AbstractAction _invariant
    This field records the invariant, if any, associated with a state.
    protected AbstractState _left
    This field organizes a state machine as a binary tree.
    protected static char _Left_parenthesis
    Management facility: this method is offered by a software component, which implements the Manageable_base interface.
    protected java.lang.String _name
    This field records the name of a state.
    protected AbstractState _node
    This field organizes a state machine as a binary tree.
    protected boolean _outputState
    This field records if a state is an output state.
    protected static java.lang.String _PlantUML_entry_point  
    protected static java.lang.String _PlantUML_exit_point  
    protected static java.lang.String _PlantUML_state  
    protected static java.lang.String _PlantUML_state_entry_point  
    protected static java.lang.String _PlantUML_state_exit_point  
    protected static java.lang.String _PlantUML_transition  
    protected static java.lang.String _PlantUML_transition_  
    protected static java.lang.String _PlantUML_transition_execution  
    protected AbstractState _right
    This field organizes a state machine as a binary tree.
    protected static char _Right_parenthesis  
    protected boolean _xor
    This field records if the two direct substates of this state are exclusive or orthogonal.
    static java.lang.String Activated_state_display_message
    For trace and visualization purposes: this class variable is used by the verbose mode.
    static java.lang.String Allow_header_text
    For trace and visualization purposes: this class variable is used by the verbose mode.
    static java.lang.String Allowed_event_display_message
    For trace and visualization purposes: this class variable is used by the verbose mode.
    static java.lang.String Completion
    This class variable is a constant value ("completion"), which is used for transitions that do not have a labeling event.
    static java.lang.String Disactivated_state_display_message
    For trace and visualization purposes: this class variable is used by the verbose mode.
    static java.lang.String Do_activity_display_message
    For trace and visualization purposes: this class variable is used by the verbose mode.
    static java.lang.String Do_header_text
    For trace and visualization purposes: this class variable is used by the verbose mode.
    static java.lang.String Entry_action_display_message
    For trace and visualization purposes: this class variable is used by the verbose mode.
    static java.lang.String Entry_header_text
    For trace and visualization purposes: this class variable is used by the verbose mode.
    static java.lang.String Exit_action_display_message
    For trace and visualization purposes: this class variable is used by the verbose mode.
    static java.lang.String Exit_header_text
    For trace and visualization purposes: this class variable is used by the verbose mode.
    static java.lang.String Invariant_header_text
    For trace and visualization purposes: this class variable is used by the verbose mode.
    static char Neutral_character
    For visualization purposes only: this class variable is used by the PauWare2Web tool to replace unacceptable characters.
    static byte No_reentrance
    This class variable is a constant value.
    static java.lang.String Pseudo_event
    This class variable is a constant value ("pseudo-event"), which is used to name events by default.
    static java.lang.String Pseudo_state
    This class variable is a constant value ( "pseudo-state") which is used to name states by default.
    static byte Reentrance
    This class variable is a constant value.
    static char Sequence_character
    This class variable defines the sign for computing sequence.
    static java.lang.String State_name_separator
    This class variable is a constant value which is used for the naming of states when state machines are composed.
    static java.lang.String Textual_view_subject_separator
    For visualization purposes only: this class variable is used for breaking into pieces textual views, which are later processed by the PauWare2Web tool.
  • Constructor Summary

    Constructors
    Modifier Constructor Description
    protected AbstractState()
    Internal use only; This constructor creates a state.
    protected AbstractState​(java.lang.String name)
    Internal use only; This constructor creates a state.
  • Method Summary

    Modifier and Type Method Description
    protected java.lang.String _compute_state_views​(java.util.Map<java.lang.String,​java.util.Set<java.lang.String>> transition_views)
    For visualization purposes only: this recursive method is internally called by the AbstractStateMachine.to_PlantUML() method to compute the state views of the state machine.
    protected AbstractState._Cross_over _cross_over​(AbstractState from)
    For visualization purposes only, private use
    protected abstract AbstractAction action​(java.lang.Object object, java.lang.String action, java.lang.Object[] args, byte reentrance_mode)
    Implementation of this method occurs in State.
    boolean active()
    This method indicates if a state is active.
    protected abstract AbstractAction activity​(java.lang.Object object, java.lang.String action, java.lang.Object[] args)
    Implementation of this method occurs in State.
    void allowedEvent​(java.lang.String event, java.lang.Object object, java.lang.String action)
    This method amounts to calling allowedEvent(event,object,action,null);.
    void allowedEvent​(java.lang.String event, java.lang.Object object, java.lang.String action, java.lang.Object[] args)
    This method amounts to calling allowedEvent(event,object,action,args,AbstractState.No_reentrance);.
    void allowedEvent​(java.lang.String event, java.lang.Object object, java.lang.String action, java.lang.Object[] args, byte reentrance_mode)
    This method amounts to calling allowedEvent(event,null,"true",object,action,args,reentrance_mode);.
    void allowedEvent​(java.lang.String event, java.lang.Object guard_object, java.lang.String guard_action, java.lang.Object[] guard_args, java.lang.Object object, java.lang.String action)
    This method amounts to calling allowedEvent(event,guard_object,guard_action,guard_args,object,action,null);.
    void allowedEvent​(java.lang.String event, java.lang.Object guard_object, java.lang.String guard_action, java.lang.Object[] guard_args, java.lang.Object object, java.lang.String action, byte reentrance_mode)
    This method amounts to calling allowedEvent(event,guard_object,guard_action,guard_args,object,action,null,reentrance_mode);.
    void allowedEvent​(java.lang.String event, java.lang.Object guard_object, java.lang.String guard_action, java.lang.Object[] guard_args, java.lang.Object object, java.lang.String action, java.lang.Object[] args)
    This method amounts to calling allowedEvent(event,guard_object,guard_action,guard_args,object,action,args,AbstractState.No_reentrance);.
    void allowedEvent​(java.lang.String event, java.lang.Object guard_object, java.lang.String guard_action, java.lang.Object[] guard_args, java.lang.Object object, java.lang.String action, java.lang.Object[] args, byte reentrance_mode)
    This method registers the allowed events for a given state.
    void allowedEvent​(java.lang.String event, java.lang.Object guard_object, java.lang.String guard_action, java.lang.Object object, java.lang.String action)
    This method amounts to calling allowedEvent(event,guard_object,guard_action,null,object,action,null,AbstractState.No_reentrance);.
    void allowedEvent​(java.lang.String event, java.lang.Object guard_object, java.lang.String guard_action, java.lang.Object object, java.lang.String action, byte reentrance_mode)
    This method amounts to calling allowedEvent(event,guard_object,guard_action,null,object,action,null,reentrance_mode);.
    void allowedEvent​(java.lang.String event, java.lang.Object guard_object, java.lang.String guard_action, java.lang.Object object, java.lang.String action, java.lang.Object[] args)
    This method amounts to calling allowedEvent(event,guard_object,guard_action,null,object,action,args,AbstractState.No_reentrance);.
    void allowedEvent​(java.lang.String event, java.lang.Object guard_object, java.lang.String guard_action, java.lang.Object object, java.lang.String action, java.lang.Object[] args, byte reentrance_mode)
    This method amounts to calling allowedEvent(event,guard_object,guard_action,null,object,action,args,reentrance_mode);.
    protected void allowedEvent​(java.lang.String event, java.util.Map<Transition,​java.lang.Object[]> execution, java.util.Vector<Transition> eliminated_transitions, java.lang.StringBuffer verbose)
    This method executes the actions of allowed events, which are eligible during a run-to-completion cycle; For internal use only.
    protected AbstractState ancestor()
    Internal use only; This method computes the closest non-anonymous superstate of a state.
    AbstractState and​(AbstractState s)
    This method makes the two argument states orthogonal.
    AbstractStateMachine and​(AbstractStateMachine s)
    This method makes a state and a state machine orthogonal.
    protected AbstractState brother()
    Internal use only; This method computes the "brother" state, if any, of a state.
    static java.lang.String Clean_up​(java.lang.String name)
    For visualization purposes only: this class method is used by the PauWare2Web tool to clean up unacceptable characters.
    protected AbstractState commonSuperWith​(AbstractState s)
    Internal use only; This method computes the closest superstate of two states.
    protected abstract AbstractState createFather()
    This method aims at managing nesting.
    java.lang.String current_state()  
    void deep_history()
    This method amounts to configuring a state as a (deep) history state: H* notation.
    protected java.lang.String deepStateInvariant()
    Internal use only; This method computes the global invariant of a state machine.
    AbstractState doActivity​(java.lang.Object object, java.lang.String activity)
    This method amounts to calling doActivity(object,activity,null);.
    AbstractState doActivity​(java.lang.Object object, java.lang.String activity, java.lang.Object[] args)
    This method associates an activity a with a state according to the following UML formalism: do/ a.
    protected void entry​(java.util.Stack<AbstractState> state_execution_flow, java.lang.StringBuffer verbose)
    Internal use only; This method is called at state machine starting time.
    protected boolean exit​(java.lang.StringBuffer verbose)
    Internal use only; This method is called at state machine stopping time for any run-to-completion cycle.
    boolean fictitious()
    This method answers the question: is this state a fictitious state (i.e., both leaf and pseudo-state) of the state machine?
    java.lang.String get_allowed_events_label()
    This method returns the allow: actions of the state.
    java.lang.String get_do_label()
    This method returns the do/ activity of the state.
    java.lang.String get_invariant_label()
    This method returns the invariant: action of the state.
    protected abstract AbstractGuard guard​(java.lang.Object guard_object, java.lang.String guard_action, java.lang.Object[] guard_args)
    Implementation of this method occurs in State.
    boolean hasForSuperState​(AbstractState s)
    This method indicates whether the argument state is a direct or indirect superstate of this.
    void inputState()
    This method forces a state to be an input state.
    boolean is_deep_history()
    This method tests if a state is a (deep) history state.
    boolean is_shallow_history()
    This method tests if a state is a (shallow) history state.
    boolean isAndWith​(AbstractState s)
    This method indicates if two states are orthogonal (deep).
    boolean isInputState()
    This method tests if a state is an input state.
    boolean isOutputState()
    This method tests if a state is an output state.
    boolean isXorWith​(AbstractState s)
    This method indicates if two states are exclusive.
    boolean leaf()
    This method answers the question: is this state a leaf state (i.e., without direct or indirect substates) of the state machine?
    protected AbstractState lookup​(java.lang.String name)
    Internal use only; This method is called by AbstractStateMachine.to_state(String).
    java.lang.String name()
    This method returns the name of a state.
    AbstractState name​(java.lang.String name)
    This method enables the naming of a state.Caution: there is no naming checking in PauWare.For instance, naming two states with the same name would probably lead to unpredictable behaviors, even defects.
    void outputState()
    This method forces a state to be an output state.
    AbstractState reset_entryAction​(java.lang.Object object, java.lang.String action)
    This method amounts to calling reset_entryAction(object,action,null);.
    AbstractState reset_entryAction​(java.lang.Object object, java.lang.String action, java.lang.Object[] args)
    This method amounts to calling reset_entryAction(object,action,args,AbstractState.No_reentrance);.
    AbstractState reset_entryAction​(java.lang.Object object, java.lang.String action, java.lang.Object[] args, byte reentrance_mode)
    This method associates an action a with a state according to the following UML formalism: entry/ a.
    AbstractState reset_exitAction​(java.lang.Object object, java.lang.String action)
    This method amounts to calling reset_exitAction(object,action,null);.
    AbstractState reset_exitAction​(java.lang.Object object, java.lang.String action, java.lang.Object[] args)
    This method amounts to calling reset_exitAction(object,action,args,AbstractState.No_reentrance);.
    AbstractState reset_exitAction​(java.lang.Object object, java.lang.String action, java.lang.Object[] args, byte reentrance_mode)
    This method associates an action a with a state according to the following UML formalism: exit/ a.
    boolean root()
    This method answers the question: is this state the most outer state of the state machine? The answer must always be false for an instance of the AbstractState type.
    protected void set_completion​(AbstractState s)
    Completion transitions (i.e., those without any event label) are automatically triggered when reaching output states.
    AbstractState set_entryAction​(java.lang.Object object, java.lang.String action)
    This method amounts to calling set_entryAction(object,action,null);.
    AbstractState set_entryAction​(java.lang.Object object, java.lang.String action, java.lang.Object[] args)
    This method amounts to calling set_entryAction(object,action,args,AbstractState.No_reentrance);.
    AbstractState set_entryAction​(java.lang.Object object, java.lang.String action, java.lang.Object[] args, byte reentrance_mode)
    This method associates an action a with a state according to the following UML formalism: entry/ a.
    AbstractState set_exitAction​(java.lang.Object object, java.lang.String action)
    This method amounts to calling set_exitAction(object,action,null);.
    AbstractState set_exitAction​(java.lang.Object object, java.lang.String action, java.lang.Object[] args)
    This method amounts to calling set_exitAction(object,action,args,AbstractState.No_reentrance);.
    AbstractState set_exitAction​(java.lang.Object object, java.lang.String action, java.lang.Object[] args, byte reentrance_mode)
    This method associates an action a with a state according to the following UML formalism: exit/ a.
    void shallow_history()
    This method amounts to configuring a state as a (shallow) history state: H notation.
    protected java.lang.String shallowStateInvariant()
    Internal use only; This method computes the invariant of a state, this state being active or not at call time.
    AbstractState stateInvariant​(java.lang.Object object, java.lang.String invariant)
    This method amounts to calling stateInvariant(object,invariant,null);.
    AbstractState stateInvariant​(java.lang.Object object, java.lang.String invariant, java.lang.Object[] args)
    This method associates an invariant with a state as proposed by the UML formalism.
    void verify()
    Management facility: this method is a utility for runtime checking.
    AbstractState xor​(AbstractState s)
    This method makes two states exclusive.

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Field Details

    • Sequence_character

      public static final char Sequence_character
      This class variable defines the sign for computing sequence.
      Since:
      ver. 1.3
      See Also:
      Constant Field Values
    • State_name_separator

      public static final java.lang.String State_name_separator
      This class variable is a constant value which is used for the naming of states when state machines are composed.
      Since:
      ver. 1.2
      See Also:
      Constant Field Values
    • No_reentrance

      public static final byte No_reentrance
      This class variable is a constant value. It represents the fact that an event sending IS NOT the cause of reentrance. This is the default mode in PauWare.
      See Also:
      AbstractStateMachine.fires(String,AbstractState,AbstractState,Object,String,Object[],Object,String,Object[],byte), Constant Field Values
    • Reentrance

      public static final byte Reentrance
      This class variable is a constant value. It represents the fact that an event sending IS the cause of reentrance. For an event sender (state machine), using this constant value avoids receiving destabilizing events while it has not completed its run-to-completion cycle.
      See Also:
      AbstractStateMachine.fires(String,AbstractState,AbstractState,Object,String,Object[],Object,String,Object[],byte), Constant Field Values
    • Completion

      public static final java.lang.String Completion
      This class variable is a constant value ("completion"), which is used for transitions that do not have a labeling event. As a result, events must not be named "completion".
      See Also:
      Constant Field Values
    • Pseudo_event

      public static final java.lang.String Pseudo_event
      This class variable is a constant value ("pseudo-event"), which is used to name events by default. As a result, events must not be named "pseudo-event".
      See Also:
      Constant Field Values
    • Pseudo_state

      public static final java.lang.String Pseudo_state
      This class variable is a constant value ( "pseudo-state") which is used to name states by default. As a result, states must not be named "pseudo-state". Note: fictitious states are created when states are composed together by means of the nesting, xor and and operators. If they are not named, these states have no "true existence" in UML State Machine Diagrams. They consequently just play the role of "composites" (a.k.a. "regions" in UML) in order to properly organize the state machine within the memory.
      See Also:
      name(String), Constant Field Values
    • _active

      protected boolean _active
      This field records if a state is active.
      See Also:
      active()
    • _do

      protected AbstractAction _do
      This field records the activity, if any, associated with a state.
      See Also:
      doActivity(Object,String,Object[])
    • _entry

      protected final java.util.Vector<AbstractAction> _entry
      This field records the action(s), if any, associated with a state when entering it.
      See Also:
      set_entryAction(Object,String,Object[],byte), reset_entryAction(Object,String,Object[],byte)
    • _exit

      protected final java.util.Vector<AbstractAction> _exit
      This field records the action(s), if any, associated with a state when exiting it.
      See Also:
      set_exitAction(Object,String,Object[],byte), reset_exitAction(Object,String,Object[],byte)
    • _allowed_events

      protected final java.util.Map<java.lang.String,​java.util.Map<AbstractGuard,​java.util.Vector<AbstractAction>>> _allowed_events
      This field records the allowed events of a state with their possible associated guards and their respective associated actions. Note: by definition, allowed events bypass entry and exit actions.
      See Also:
      allowedEvent(String,Object,String,Object[],Object,String,Object[],byte)
    • _invariant

      protected AbstractAction _invariant
      This field records the invariant, if any, associated with a state.
      See Also:
      stateInvariant(Object,String,Object[])
    • _inputState

      protected boolean _inputState
      This field records if a state is an input state.
      See Also:
      inputState()
    • _outputState

      protected boolean _outputState
      This field records if a state is an output state.
      See Also:
      outputState()
    • _name

      protected java.lang.String _name
      This field records the name of a state. The default name is Pseudo_state.
      See Also:
      Pseudo_state
    • _left

      protected AbstractState _left
      This field organizes a state machine as a binary tree. This field may be left null (meaning that the state is a leaf state). In such a case, one must have _right == null.
    • _node

      protected AbstractState _node
      This field organizes a state machine as a binary tree. If the type of the state owning this field is AbstractState, this field cannot be left null (meaning that the state is a direct or indirect substate of the state machine itself). Otherwise if this state is an instance of AbstractStateMachine, this field must be equal to null.
    • _right

      protected AbstractState _right
      This field organizes a state machine as a binary tree. This field may be left null (meaning that the state is a leaf state). In such a case, one must have _left == null.
    • _xor

      protected boolean _xor
      This field records if the two direct substates of this state are exclusive or orthogonal.
      See Also:
      xor(AbstractState), and(AbstractState)
    • _Left_parenthesis

      protected static final char _Left_parenthesis
      Management facility: this method is offered by a software component, which implements the Manageable_base interface.
      See Also:
      Manageable_base, Constant Field Values
    • _Right_parenthesis

      protected static final char _Right_parenthesis
      See Also:
      Constant Field Values
    • _AND

      protected static final java.lang.String _AND
      See Also:
      Constant Field Values
    • Allow_header_text

      public static final java.lang.String Allow_header_text
      For trace and visualization purposes: this class variable is used by the verbose mode. It is also used by PauWare2Web tool to control what is displayed on the HTML page.
      Since:
      ver. 1.3.
      See Also:
      Constant Field Values
    • Exit_header_text

      public static final java.lang.String Exit_header_text
      For trace and visualization purposes: this class variable is used by the verbose mode. It is also used by PauWare2Web tool to control what is displayed on the HTML page.
      Since:
      ver. 1.3.
      See Also:
      Constant Field Values
    • Entry_header_text

      public static final java.lang.String Entry_header_text
      For trace and visualization purposes: this class variable is used by the verbose mode. It is also used by PauWare2Web tool to control what is displayed on the HTML page.
      Since:
      ver. 1.3.
      See Also:
      Constant Field Values
    • Do_header_text

      public static final java.lang.String Do_header_text
      For trace and visualization purposes: this class variable is used by the verbose mode. It is also used by PauWare2Web tool to control what is displayed on the HTML page.
      Since:
      ver. 1.3.
      See Also:
      Constant Field Values
    • Invariant_header_text

      public static final java.lang.String Invariant_header_text
      For trace and visualization purposes: this class variable is used by the verbose mode. It is also used by PauWare2Web tool to control what is displayed on the HTML page.
      Since:
      ver. 1.3.
      See Also:
      Constant Field Values
    • Allowed_event_display_message

      public static final java.lang.String Allowed_event_display_message
      For trace and visualization purposes: this class variable is used by the verbose mode. It is also used by PauWare2Web tool to control what is displayed on the HTML page.
      Since:
      ver. 1.3.
      See Also:
      Constant Field Values
    • Exit_action_display_message

      public static final java.lang.String Exit_action_display_message
      For trace and visualization purposes: this class variable is used by the verbose mode. It is also used by PauWare2Web tool to control what is displayed on the HTML page.
      Since:
      ver. 1.3.
      See Also:
      Constant Field Values
    • Disactivated_state_display_message

      public static final java.lang.String Disactivated_state_display_message
      For trace and visualization purposes: this class variable is used by the verbose mode. It is also used by PauWare2Web tool to control what is displayed on the HTML page.
      Since:
      ver. 1.3.
      See Also:
      Constant Field Values
    • Entry_action_display_message

      public static final java.lang.String Entry_action_display_message
      For trace and visualization purposes: this class variable is used by the verbose mode. It is also used by PauWare2Web tool to control what is displayed on the HTML page.
      Since:
      ver. 1.3.
      See Also:
      Constant Field Values
    • Do_activity_display_message

      public static final java.lang.String Do_activity_display_message
      For trace and visualization purposes: this class variable is used by the verbose mode. It is also used by PauWare2Web tool to control what is displayed on the HTML page.
      Since:
      ver. 1.3.
      See Also:
      Constant Field Values
    • Activated_state_display_message

      public static final java.lang.String Activated_state_display_message
      For trace and visualization purposes: this class variable is used by the verbose mode. It is also used by PauWare2Web tool to control what is displayed on the HTML page.
      Since:
      ver. 1.3.
      See Also:
      Constant Field Values
    • Neutral_character

      public static final char Neutral_character
      For visualization purposes only: this class variable is used by the PauWare2Web tool to replace unacceptable characters.
      Since:
      ver. 1.3
      See Also:
      Constant Field Values
    • Textual_view_subject_separator

      public static final java.lang.String Textual_view_subject_separator
      For visualization purposes only: this class variable is used for breaking into pieces textual views, which are later processed by the PauWare2Web tool.
      Since:
      ver. 1.3
      See Also:
      Constant Field Values
    • _PlantUML_entry_point

      protected static final java.lang.String _PlantUML_entry_point
      See Also:
      Constant Field Values
    • _PlantUML_exit_point

      protected static final java.lang.String _PlantUML_exit_point
      See Also:
      Constant Field Values
    • _PlantUML_state

      protected static final java.lang.String _PlantUML_state
      See Also:
      Constant Field Values
    • _PlantUML_state_entry_point

      protected static final java.lang.String _PlantUML_state_entry_point
      See Also:
      Constant Field Values
    • _PlantUML_state_exit_point

      protected static final java.lang.String _PlantUML_state_exit_point
      See Also:
      Constant Field Values
    • _PlantUML_transition

      protected static final java.lang.String _PlantUML_transition
      See Also:
      Constant Field Values
    • _PlantUML_transition_

      protected static final java.lang.String _PlantUML_transition_
      See Also:
      Constant Field Values
    • _PlantUML_transition_execution

      protected static final java.lang.String _PlantUML_transition_execution
      See Also:
      Constant Field Values
  • Constructor Details

    • AbstractState

      protected AbstractState()
      Internal use only; This constructor creates a state. This constructor is imposed by the fact that State objects are serializable.
      See Also:
      State
    • AbstractState

      protected AbstractState​(java.lang.String name)
      Internal use only; This constructor creates a state.
      Parameters:
      name - If name is equal to null, the name of the state is already set to Pseudo_state.
      See Also:
      Pseudo_state
  • Method Details

    • action

      protected abstract AbstractAction action​(java.lang.Object object, java.lang.String action, java.lang.Object[] args, byte reentrance_mode)
      Implementation of this method occurs in State.
      See Also:
      Action
    • activity

      protected abstract AbstractAction activity​(java.lang.Object object, java.lang.String action, java.lang.Object[] args)
      Implementation of this method occurs in State.
      See Also:
      Action
    • guard

      protected abstract AbstractGuard guard​(java.lang.Object guard_object, java.lang.String guard_action, java.lang.Object[] guard_args)
      Implementation of this method occurs in State.
      See Also:
      Guard
    • createFather

      protected abstract AbstractState createFather()
      This method aims at managing nesting.
      Returns:
    • xor

      This method makes two states exclusive. States which are already linked to other states (by nesting, exclusion or orthogonality relationships) cannot be involved in this method. PauWare propagates nesting, exclusion and orthogonality relationships through states by means of transitivity.
      Returns:
      A new state being the direct superstate of the two XOR-based linked states. This new state may be named by using the name(String) method; Otherwise it is a pseudo-state (see Pseudo_state)
      Throws:
      State_based_exception - A XOR error (concerning the two incriminated states) if the exclusion link cannot be operated.
      See Also:
      hasForSuperState(AbstractState), isAndWith(AbstractState), isXorWith(AbstractState)
    • and

      This method makes the two argument states orthogonal. States which are already linked to other states (by nesting, exclusion or orthogonality relationships) cannot be involved in this method. PauWare propagates nesting, exclusion and orthogonality relationships through states by means of transitivity.
      Returns:
      A new state being the direct superstate of the two AND-based linked states. This new state may be named by using the name(String) method; Otherwise it is a pseudo-state (see Pseudo_state)
      Throws:
      State_based_exception - An AND error with the two incriminated states if the orthogonality link cannot be operated
      See Also:
      hasForSuperState(AbstractState), isAndWith(AbstractState), isXorWith(AbstractState)
    • and

      This method makes a state and a state machine orthogonal.
      Throws:
      State_based_exception
      Since:
      ver. 1.2
    • active

      public boolean active()
      This method indicates if a state is active.
    • brother

      protected AbstractState brother()
      Internal use only; This method computes the "brother" state, if any, of a state. If the type of the state is AbstractState, the returned value cannot be null.
      Returns:
      The "brother" state or null if this state is an instance of AbstractStateMachine (i.e., an instance of a state machine).
    • commonSuperWith

      protected AbstractState commonSuperWith​(AbstractState s)
      Internal use only; This method computes the closest superstate of two states. The common superstate may be the state machine itself (i.e., an instance of AbstractStateMachine).
    • ancestor

      protected AbstractState ancestor()
      Internal use only; This method computes the closest non-anonymous superstate of a state. This superstate may be the state machine itself (i.e., an instance of AbstractStateMachine).
    • hasForSuperState

      public boolean hasForSuperState​(AbstractState s)
      This method indicates whether the argument state is a direct or indirect superstate of this.
    • isAndWith

      public boolean isAndWith​(AbstractState s)
      This method indicates if two states are orthogonal (deep).
      Parameters:
      s - The state for which orthogonality is established or not.
      Returns:
    • isXorWith

      public boolean isXorWith​(AbstractState s)
      This method indicates if two states are exclusive.
      Parameters:
      s - The state for which exclusion is established or not.
      Returns:
    • allowedEvent

      public void allowedEvent​(java.lang.String event, java.lang.Object object, java.lang.String action)
      This method amounts to calling allowedEvent(event,object,action,null);.
    • allowedEvent

      public void allowedEvent​(java.lang.String event, java.lang.Object object, java.lang.String action, java.lang.Object[] args)
      This method amounts to calling allowedEvent(event,object,action,args,AbstractState.No_reentrance);.
    • allowedEvent

      public void allowedEvent​(java.lang.String event, java.lang.Object object, java.lang.String action, java.lang.Object[] args, byte reentrance_mode)
      This method amounts to calling allowedEvent(event,null,"true",object,action,args,reentrance_mode);.
    • allowedEvent

      public void allowedEvent​(java.lang.String event, java.lang.Object guard_object, java.lang.String guard_action, java.lang.Object object, java.lang.String action)
      This method amounts to calling allowedEvent(event,guard_object,guard_action,null,object,action,null,AbstractState.No_reentrance);.
    • allowedEvent

      public void allowedEvent​(java.lang.String event, java.lang.Object guard_object, java.lang.String guard_action, java.lang.Object object, java.lang.String action, byte reentrance_mode)
      This method amounts to calling allowedEvent(event,guard_object,guard_action,null,object,action,null,reentrance_mode);.
    • allowedEvent

      public void allowedEvent​(java.lang.String event, java.lang.Object guard_object, java.lang.String guard_action, java.lang.Object object, java.lang.String action, java.lang.Object[] args)
      This method amounts to calling allowedEvent(event,guard_object,guard_action,null,object,action,args,AbstractState.No_reentrance);.
    • allowedEvent

      public void allowedEvent​(java.lang.String event, java.lang.Object guard_object, java.lang.String guard_action, java.lang.Object object, java.lang.String action, java.lang.Object[] args, byte reentrance_mode)
      This method amounts to calling allowedEvent(event,guard_object,guard_action,null,object,action,args,reentrance_mode);.
    • allowedEvent

      public void allowedEvent​(java.lang.String event, java.lang.Object guard_object, java.lang.String guard_action, java.lang.Object[] guard_args, java.lang.Object object, java.lang.String action)
      This method amounts to calling allowedEvent(event,guard_object,guard_action,guard_args,object,action,null);.
    • allowedEvent

      public void allowedEvent​(java.lang.String event, java.lang.Object guard_object, java.lang.String guard_action, java.lang.Object[] guard_args, java.lang.Object object, java.lang.String action, byte reentrance_mode)
      This method amounts to calling allowedEvent(event,guard_object,guard_action,guard_args,object,action,null,reentrance_mode);.
    • allowedEvent

      public void allowedEvent​(java.lang.String event, java.lang.Object guard_object, java.lang.String guard_action, java.lang.Object[] guard_args, java.lang.Object object, java.lang.String action, java.lang.Object[] args)
      This method amounts to calling allowedEvent(event,guard_object,guard_action,guard_args,object,action,args,AbstractState.No_reentrance);.
    • allowedEvent

      public void allowedEvent​(java.lang.String event, java.lang.Object guard_object, java.lang.String guard_action, java.lang.Object[] guard_args, java.lang.Object object, java.lang.String action, java.lang.Object[] args, byte reentrance_mode)
      This method registers the allowed events for a given state.
    • allowedEvent

      protected void allowedEvent​(java.lang.String event, java.util.Map<Transition,​java.lang.Object[]> execution, java.util.Vector<Transition> eliminated_transitions, java.lang.StringBuffer verbose)
      This method executes the actions of allowed events, which are eligible during a run-to-completion cycle; For internal use only.
    • get_allowed_events_label

      public java.lang.String get_allowed_events_label()
      This method returns the allow: actions of the state.
      Returns:
      The allow: actions (if any) in a printable form
    • shallow_history

      public void shallow_history()
      This method amounts to configuring a state as a (shallow) history state: H notation. History setup is only possible after full state machine structuring.
    • deep_history

      public void deep_history()
      This method amounts to configuring a state as a (deep) history state: H* notation. History setup is only possible after full state machine structuring.
    • is_shallow_history

      public boolean is_shallow_history()
      This method tests if a state is a (shallow) history state.
    • is_deep_history

      public boolean is_deep_history()
      This method tests if a state is a (deep) history state.
    • doActivity

      public AbstractState doActivity​(java.lang.Object object, java.lang.String activity)
      This method amounts to calling doActivity(object,activity,null);.
    • doActivity

      public AbstractState doActivity​(java.lang.Object object, java.lang.String activity, java.lang.Object[] args)
      This method associates an activity a with a state according to the following UML formalism: do/ a. Only one activity may be setup for the same state. Normally, activities are not intended to communicate with other software components. It is thus preferable to encapsulate local data transformations in activities. Such transformations are not supposed to require any control, synchronization, etc.
      Returns:
      The state itself
    • get_do_label

      public java.lang.String get_do_label()
      This method returns the do/ activity of the state.
      Returns:
      The do/ activity (if any) in a printable form.
    • set_entryAction

      public AbstractState set_entryAction​(java.lang.Object object, java.lang.String action)
      This method amounts to calling set_entryAction(object,action,null);.
    • set_entryAction

      public AbstractState set_entryAction​(java.lang.Object object, java.lang.String action, java.lang.Object[] args)
      This method amounts to calling set_entryAction(object,action,args,AbstractState.No_reentrance);.
    • set_entryAction

      public AbstractState set_entryAction​(java.lang.Object object, java.lang.String action, java.lang.Object[] args, byte reentrance_mode)
      This method associates an action a with a state according to the following UML formalism: entry/ a. Multiple actions for the same state require multiple uses of this method.
      Parameters:
      reentrance_mode - The Reentrance class variable may be used as a value for this parameter; This value prevents unanticipated reentrance
      Returns:
      The state itself
    • reset_entryAction

      public AbstractState reset_entryAction​(java.lang.Object object, java.lang.String action)
      This method amounts to calling reset_entryAction(object,action,null);.
    • reset_entryAction

      public AbstractState reset_entryAction​(java.lang.Object object, java.lang.String action, java.lang.Object[] args)
      This method amounts to calling reset_entryAction(object,action,args,AbstractState.No_reentrance);.
    • reset_entryAction

      public AbstractState reset_entryAction​(java.lang.Object object, java.lang.String action, java.lang.Object[] args, byte reentrance_mode)
      This method associates an action a with a state according to the following UML formalism: entry/ a. This method aims at erasing an already recorded entry action due to the change of the object and/or args parameters.
      Parameters:
      reentrance_mode - The Reentrance class variable may be used as a value for this parameter; This value prevents unanticipated reentrance
      Returns:
      The state itself
    • set_exitAction

      public AbstractState set_exitAction​(java.lang.Object object, java.lang.String action)
      This method amounts to calling set_exitAction(object,action,null);.
    • set_exitAction

      public AbstractState set_exitAction​(java.lang.Object object, java.lang.String action, java.lang.Object[] args)
      This method amounts to calling set_exitAction(object,action,args,AbstractState.No_reentrance);.
    • set_exitAction

      public AbstractState set_exitAction​(java.lang.Object object, java.lang.String action, java.lang.Object[] args, byte reentrance_mode)
      This method associates an action a with a state according to the following UML formalism: exit/ a. Multiple actions for the same state require multiple uses of this method.
      Parameters:
      reentrance_mode - The Reentrance class variable may be used as a value for this parameter; This value prevents unanticipated reentrance
      Returns:
      The state itself
    • reset_exitAction

      public AbstractState reset_exitAction​(java.lang.Object object, java.lang.String action)
      This method amounts to calling reset_exitAction(object,action,null);.
    • reset_exitAction

      public AbstractState reset_exitAction​(java.lang.Object object, java.lang.String action, java.lang.Object[] args)
      This method amounts to calling reset_exitAction(object,action,args,AbstractState.No_reentrance);.
    • reset_exitAction

      public AbstractState reset_exitAction​(java.lang.Object object, java.lang.String action, java.lang.Object[] args, byte reentrance_mode)
      This method associates an action a with a state according to the following UML formalism: exit/ a. This method aims at erasing an already recorded exit action due to the change of the object and/or args parameters.
      Parameters:
      reentrance_mode - The Reentrance class variable may be used as a value for this parameter; This value prevents unanticipated reentrance
      Returns:
      The state itself
    • stateInvariant

      public AbstractState stateInvariant​(java.lang.Object object, java.lang.String invariant)
      This method amounts to calling stateInvariant(object,invariant,null);.
    • stateInvariant

      public AbstractState stateInvariant​(java.lang.Object object, java.lang.String invariant, java.lang.Object[] args)
      This method associates an invariant with a state as proposed by the UML formalism. Only one invariant may be setup for the same state. An invariant is evaluated during a run-to-completion cycle by means of a (dedicated) executed action.
      Parameters:
      object - The object in charge of executing the action, corresponding to the invariant to be evaluated
      invariant - The action to be executed, corresponding to the invariant to be evaluated
      args - The action's arguments, if any
      Returns:
      The state itself
      See Also:
      AbstractStateMachine.run_to_completion(String,boolean)
    • shallowStateInvariant

      protected java.lang.String shallowStateInvariant() throws State_exception
      Internal use only; This method computes the invariant of a state, this state being active or not at call time.
      Returns:
      The result of evaluating the state's invariant by calling the Java method, if any, attached to this state as invariant evaluator This methods returns true if there is no attached evaluation method or the latter does not return a Boolean type and no exception occurs when calling it In contrast, this methods raises an exception if the state still lasts (its attached activity is not terminated) or an exception occurs when evaluating the invariant
      Throws:
      State_exception
      See Also:
      stateInvariant(Object,String,Object[]), deepStateInvariant()
    • deepStateInvariant

      protected java.lang.String deepStateInvariant() throws State_exception
      Internal use only; This method computes the global invariant of a state machine. This invariant is equal to a logical and for all of the invariants of its active states.
      Throws:
      State_exception
      See Also:
      stateInvariant(Object,String,Object[]), shallowStateInvariant(), AbstractStateMachine.run_to_completion(String,boolean)
    • get_invariant_label

      public java.lang.String get_invariant_label()
      This method returns the invariant: action of the state.
      Returns:
      The invariant: action (if any) in a printable form.
    • entry

      protected void entry​(java.util.Stack<AbstractState> state_execution_flow, java.lang.StringBuffer verbose) throws State_exception
      Internal use only; This method is called at state machine starting time. It is also called within any run-to-completion cycle. In this latter case, this method is called by AbstractStateMachine.activate(AbstractState,AbstractState,StringBuffer).
      Throws:
      State_exception
    • exit

      protected boolean exit​(java.lang.StringBuffer verbose) throws State_exception
      Internal use only; This method is called at state machine stopping time for any run-to-completion cycle. This method is called by AbstractStateMachine.disactivate(AbstractState,AbstractState,StringBuffer).
      Throws:
      State_exception
    • inputState

      public void inputState()
      This method forces a state to be an input state. The UML notation is a black point with an arrow pointing to the state. At state machine creation time, some states of a state machine must be declared as input states in order to guarantee the state machine's determinism.
      See Also:
      AbstractStateMachine(AbstractState,String,boolean)
    • isInputState

      public boolean isInputState()
      This method tests if a state is an input state.
    • name

      public AbstractState name​(java.lang.String name)
      This method enables the naming of a state.Caution: there is no naming checking in PauWare.For instance, naming two states with the same name would probably lead to unpredictable behaviors, even defects.
      Parameters:
      name - The given name.
      Returns:
      The state for which the name field has just been setup.
    • outputState

      public void outputState()
      This method forces a state to be an output state. The UML notation is a black point surrounded by a circle which is pointed at by an arrow coming out of another state. This method has no effect for the moment; It will be used in a forthcoming API.
    • set_completion

      protected void set_completion​(AbstractState s)
      Completion transitions (i.e., those without any event label) are automatically triggered when reaching output states.
      Since:
      ver. 1.3
    • isOutputState

      public boolean isOutputState()
      This method tests if a state is an output state.
    • fictitious

      public boolean fictitious()
      This method answers the question: is this state a fictitious state (i.e., both leaf and pseudo-state) of the state machine?
    • leaf

      public boolean leaf()
      This method answers the question: is this state a leaf state (i.e., without direct or indirect substates) of the state machine?
    • root

      public boolean root()
      This method answers the question: is this state the most outer state of the state machine? The answer must always be false for an instance of the AbstractState type.
    • verify

      public void verify() throws State_based_exception
      Management facility: this method is a utility for runtime checking. It verifies if an active state, which has its "brother" state active, shares a orthogonality relationship with it. It also verifies if an active state, which has its "brother" state inactive, shares an exclusion relationship with it.
      Throws:
      State_based_exception
    • current_state

      public java.lang.String current_state()
    • name

      public java.lang.String name()
      This method returns the name of a state.
      Returns:
      The returned value can be the value of the Pseudo_state class variable; One has however to notice that pseudo-states do not require direct manipulation
    • lookup

      protected AbstractState lookup​(java.lang.String name) throws State_exception
      Internal use only; This method is called by AbstractStateMachine.to_state(String).
      Returns:
      The state to be reached, if any
      Throws:
      State_exception
    • Clean_up

      public static java.lang.String Clean_up​(java.lang.String name)
      For visualization purposes only: this class method is used by the PauWare2Web tool to clean up unacceptable characters.
      Parameters:
      name - The name of an event or a state in a normalized format, i.e., no space, etc.
      Returns:
      The cleaned name
      Since:
      ver. 1.3
    • _cross_over

      protected AbstractState._Cross_over _cross_over​(AbstractState from)
      For visualization purposes only, private use
      Parameters:
      from - The source state of the transition while this plays the role of the transition's target state
      Returns:
      A value of the _Cross_over enumerated type to establish how to draw the transition in the context of PlantUML strong limitations about orthogonality
      Since:
      ver. 2.0
    • _compute_state_views

      protected java.lang.String _compute_state_views​(java.util.Map<java.lang.String,​java.util.Set<java.lang.String>> transition_views)
      For visualization purposes only: this recursive method is internally called by the AbstractStateMachine.to_PlantUML() method to compute the state views of the state machine.
      Parameters:
      transition_views - The transitions in the PlantUML form.
      Returns:
      The PlantUML string from which the graph of states and transitions is computed.
      Since:
      ver. 1.3