org.argouml.model
Interface StateMachinesHelper

All Known Implementing Classes:
AbstractStateMachinesHelperDecorator

public interface StateMachinesHelper

The interface for the helper for StateMachines.

Created from the old StateMachinesHelper.


Method Summary
 void addDeferrableEvent(java.lang.Object state, java.lang.Object deferrableEvent)
          Add a deferrable event to a state.
 void addSubvertex(java.lang.Object handle, java.lang.Object subvertex)
          Add a subvertex to a composite state.
 java.lang.Object findNamespaceForEvent(java.lang.Object trans, java.lang.Object model)
          Find the correct namespace for an event.
 java.lang.Object findOperationByName(java.lang.Object trans, java.lang.String opname)
          Finds the operation to which a CallEvent refers.
 java.util.Collection getAllPossibleStatemachines(java.lang.Object model, java.lang.Object oSubmachineState)
          Returns all statemachines that can be the statemachine the given submachinestate represents.
 java.util.Collection getAllPossibleSubvertices(java.lang.Object oState)
          Returns all states that can be recursively contained by the given State.
 java.util.Collection getAllSubStates(java.lang.Object compState)
          Returns all substates some composite state contains.
 java.lang.Object getDestination(java.lang.Object trans)
          Returns the destination of the given transition.
 java.util.Collection getOutgoingStates(java.lang.Object ostatevertex)
          Gets all statevertices that are a target to transitions outgoing from the given statevertex.
 java.lang.String getPath(java.lang.Object o)
          Returns the path of a state vertex.
 java.lang.Object getSource(java.lang.Object trans)
          Returns the source of the given transition.
 java.lang.Object getStatebyName(java.lang.String path, java.lang.Object container)
          Returns a state contained into container.
 java.lang.Object getStateMachine(java.lang.Object handle)
          Gets the statemachine that contains the given Object Traverses the state hierarchy of the statemachine untill the statemachine is reached.
 java.lang.Object getTop(java.lang.Object sm)
          Get the "top" composite state of a statemachine.
 boolean isAddingStatemachineAllowed(java.lang.Object context)
          Returns true if a statemachine may be added to the given context.
 boolean isTopState(java.lang.Object o)
          Returns true is the given state is the top state.
 void removeDeferrableEvent(java.lang.Object state, java.lang.Object deferrableEvent)
          Remove a deferrable event from a state.
 void removeSubvertex(java.lang.Object handle, java.lang.Object subvertex)
          Remove a given subvertex from a given composite state.
 void setBound(java.lang.Object handle, int bound)
          Sets the Bound of some SynchState.
 void setChangeExpression(java.lang.Object handle, java.lang.Object value)
          Sets the change-expression for a ChangeEvent.
 void setConcurrent(java.lang.Object handle, boolean concurrent)
          Makes a Composite State concurrent.
 void setContainer(java.lang.Object handle, java.lang.Object compositeState)
          Set the container of a statevertex.
 void setContext(java.lang.Object statemachine, java.lang.Object modelElement)
          Set the Context of a statemachine.
 void setDoActivity(java.lang.Object handle, java.lang.Object value)
          Sets the do activity of a state.
 void setEffect(java.lang.Object handle, java.lang.Object value)
          Sets the effect of some transition.
 void setEntry(java.lang.Object handle, java.lang.Object value)
          Sets the entry action of some state.
 void setEventAsTrigger(java.lang.Object transition, java.lang.Object event)
          Couples a given event to the given transition as being trigger event.
 void setExit(java.lang.Object handle, java.lang.Object value)
          Sets the exit action of some state.
 void setExpression(java.lang.Object handle, java.lang.Object value)
          Set the Expression of a Guard or ChangeEvent.
 void setGuard(java.lang.Object handle, java.lang.Object guard)
          Sets the guard of a transition.
 void setInternalTransitions(java.lang.Object handle, java.util.Collection intTrans)
           
 void setReferenceState(java.lang.Object o, java.lang.String referenced)
          Sets the Referenced State of a StubState.
 void setSource(java.lang.Object handle, java.lang.Object state)
          Sets the source state of some message.
 void setState(java.lang.Object handle, java.lang.Object element)
          Sets the state of an internal transition.
 void setStateMachine(java.lang.Object handle, java.lang.Object stm)
          Sets a state machine of some state or transition.
 void setStatemachineAsSubmachine(java.lang.Object oSubmachineState, java.lang.Object oStatemachine)
          Connects a given statemachine to a submachinestate as being the statemachine the submachinestate represents.
 void setSubvertices(java.lang.Object handle, java.util.Collection subvertices)
          Set the collection of substates for a CompositeState.
 void setTrigger(java.lang.Object handle, java.lang.Object event)
          Sets the trigger event of a transition.
 void setWhen(java.lang.Object handle, java.lang.Object value)
          Sets the time-expression for a TimeEvent.
 

Method Detail

getSource

java.lang.Object getSource(java.lang.Object trans)
Returns the source of the given transition. This operation is here to give a full implementation of all getSource and getDestination methods on the uml helpers.

Parameters:
trans - the given transition
Returns:
MStateVertex the source statevertex

getDestination

java.lang.Object getDestination(java.lang.Object trans)
Returns the destination of the given transition. This operation is here to give a full implementation of all getSource and getDestination methods on the uml helpers.

Parameters:
trans - the given transition
Returns:
MStateVertex the destination statevertex

getStateMachine

java.lang.Object getStateMachine(java.lang.Object handle)
Gets the statemachine that contains the given Object Traverses the state hierarchy of the statemachine untill the statemachine is reached. To decouple ArgoUML as much as possible from the model implementation, the parameter of the method is of type Object, and the result, too.

Only if the given handle is null, then an exception is thrown.

Parameters:
handle - The element for which we want to know the statemachine
Returns:
Object MStateMachine The statemachine the state belongs too or null if the given handle is not contained in this statemachine

setEventAsTrigger

void setEventAsTrigger(java.lang.Object transition,
                       java.lang.Object event)
Couples a given event to the given transition as being trigger event. To decouple ArgoUML as much as possible from the model implementation, the parameters of the method are of type Object.

Parameters:
transition - the given transition
event - the given event

isAddingStatemachineAllowed

boolean isAddingStatemachineAllowed(java.lang.Object context)
Returns true if a statemachine may be added to the given context. To decouple ArgoUML as much as possible from the model implementation, the parameter of the method is of type Object.

Parameters:
context - the given context
Returns:
boolean true if a statemachine may be added

isTopState

boolean isTopState(java.lang.Object o)
Returns true is the given state is the top state.

Parameters:
o - CompositeState
Returns:
boolean

getAllPossibleStatemachines

java.util.Collection getAllPossibleStatemachines(java.lang.Object model,
                                                 java.lang.Object oSubmachineState)
Returns all statemachines that can be the statemachine the given submachinestate represents.

Parameters:
model - the model
oSubmachineState - The submachinestate we are searching the statemachines for.
Returns:
Collection The collection with found statemachines.

getAllPossibleSubvertices

java.util.Collection getAllPossibleSubvertices(java.lang.Object oState)
Returns all states that can be recursively contained by the given State.

TODO: getAllPossibleSubvertices(Object) and getAllSubStates(Object) are duplicates as implemented for MDR. It isn't clear from the Javadoc or usage whether they should do different things or this just happened because no one noticed we already had another method.

Parameters:
oState - the Composite state we are searching the states for,
Returns:
Collection the collection with found states

setStatemachineAsSubmachine

void setStatemachineAsSubmachine(java.lang.Object oSubmachineState,
                                 java.lang.Object oStatemachine)
Connects a given statemachine to a submachinestate as being the statemachine the submachinestate represents.

Parameters:
oSubmachineState - The submachinestate for which we want to set the property submachine
oStatemachine - The statemachine

getTop

java.lang.Object getTop(java.lang.Object sm)
Get the "top" composite state of a statemachine.

Parameters:
sm - the given statemachine
Returns:
the top composite state

getOutgoingStates

java.util.Collection getOutgoingStates(java.lang.Object ostatevertex)
Gets all statevertices that are a target to transitions outgoing from the given statevertex.

Parameters:
ostatevertex - the given statevertex
Returns:
Collection all statevertices that are a target

findOperationByName

java.lang.Object findOperationByName(java.lang.Object trans,
                                     java.lang.String opname)
Finds the operation to which a CallEvent refers. TODO: This function works for the most normal cases, but needs some testing for rare cases, e.g. internal transitions,...

Parameters:
trans - Object of type MTransition
opname - the name of the operation sought
Returns:
Object The operation with the given name, or null.

getAllSubStates

java.util.Collection getAllSubStates(java.lang.Object compState)
Returns all substates some composite state contains.

TODO: getAllPossibleSubvertices(Object) and getAllSubStates(Object) are duplicates as implemented for MDR. It isn't clear from the Javadoc or usage whether they should do different things or this just happened because no one noticed we already had another method.

Parameters:
compState - the given compositestate
Returns:
all substates

removeSubvertex

void removeSubvertex(java.lang.Object handle,
                     java.lang.Object subvertex)
Remove a given subvertex from a given composite state.

Parameters:
handle - the composite state
subvertex - the StateVertex

addSubvertex

void addSubvertex(java.lang.Object handle,
                  java.lang.Object subvertex)
Add a subvertex to a composite state.

Parameters:
handle - the CompositeState
subvertex - the StateVertex

setBound

void setBound(java.lang.Object handle,
              int bound)
Sets the Bound of some SynchState.

Parameters:
handle - Synch State
bound - A positive integer or the value "unlimited" specifying the maximal count of the SynchState. The count is the difference between the number of times the incoming and outgoing transitions of the synch state are fired.

setConcurrent

void setConcurrent(java.lang.Object handle,
                   boolean concurrent)
Makes a Composite State concurrent.

Parameters:
handle - the CompositState
concurrent - boolean

setContainer

void setContainer(java.lang.Object handle,
                  java.lang.Object compositeState)
Set the container of a statevertex.

Parameters:
handle - is the stateVertex
compositeState - is the container. Can be null.

setDoActivity

void setDoActivity(java.lang.Object handle,
                   java.lang.Object value)
Sets the do activity of a state.

Parameters:
handle - is the state
value - the activity. Can be null.

setEffect

void setEffect(java.lang.Object handle,
               java.lang.Object value)
Sets the effect of some transition.

Parameters:
handle - is the transition
value - is the effect. Can be null.

setEntry

void setEntry(java.lang.Object handle,
              java.lang.Object value)
Sets the entry action of some state.

Parameters:
handle - is the state
value - is the action. Can be null.

setExit

void setExit(java.lang.Object handle,
             java.lang.Object value)
Sets the exit action of some state.

Parameters:
handle - is the state
value - is the action. Can be null.

setExpression

void setExpression(java.lang.Object handle,
                   java.lang.Object value)
Set the Expression of a Guard or ChangeEvent.

Parameters:
handle - Guard or ChangeEvent
value - BooleanExpression or null

setGuard

void setGuard(java.lang.Object handle,
              java.lang.Object guard)
Sets the guard of a transition.

Parameters:
handle - to the transition
guard - to be set. Can be null.

setInternalTransitions

void setInternalTransitions(java.lang.Object handle,
                            java.util.Collection intTrans)
Parameters:
handle - is the target.
intTrans - is a collection of transitions.

setSource

void setSource(java.lang.Object handle,
               java.lang.Object state)
Sets the source state of some message.

Parameters:
handle - the message
state - the source state

setState

void setState(java.lang.Object handle,
              java.lang.Object element)
Sets the state of an internal transition.

Parameters:
handle - the internal transition
element - the state that contains this transition

setStateMachine

void setStateMachine(java.lang.Object handle,
                     java.lang.Object stm)
Sets a state machine of some state or transition.

Parameters:
handle - is the state or transition
stm - is the state machine

setSubvertices

void setSubvertices(java.lang.Object handle,
                    java.util.Collection subvertices)
Set the collection of substates for a CompositeState.

Parameters:
handle - CompositeState
subvertices - collection of sub-StateVertexes

setTrigger

void setTrigger(java.lang.Object handle,
                java.lang.Object event)
Sets the trigger event of a transition.

Parameters:
handle - is the transition
event - is the trigger event or null

setWhen

void setWhen(java.lang.Object handle,
             java.lang.Object value)
Sets the time-expression for a TimeEvent.

Parameters:
handle - Object (TimeEvent)
value - Object (TimeExpression)

setChangeExpression

void setChangeExpression(java.lang.Object handle,
                         java.lang.Object value)
Sets the change-expression for a ChangeEvent.

Parameters:
handle - Object (ChangeEvent)
value - Object (BooleanExpression)

getPath

java.lang.String getPath(java.lang.Object o)
Returns the path of a state vertex.

Parameters:
o - the StateVertex
Returns:
String

getStatebyName

java.lang.Object getStatebyName(java.lang.String path,
                                java.lang.Object container)
Returns a state contained into container.

Parameters:
path - The whole pathname of the state we are looking for.
container - of the state
Returns:
Object

setReferenceState

void setReferenceState(java.lang.Object o,
                       java.lang.String referenced)
Sets the Referenced State of a StubState.

Parameters:
o - Stub State
referenced - state

findNamespaceForEvent

java.lang.Object findNamespaceForEvent(java.lang.Object trans,
                                       java.lang.Object model)
Find the correct namespace for an event. This explained by the following quote from the UML spec: "The event declaration has scope within the package it appears in and may be used in state diagrams for classes that have visibility inside the package. An event is not local to a single class."

Parameters:
trans - the transition of which the event is a trigger
model - the default is the model
Returns:
the enclosing namespace for the event

setContext

void setContext(java.lang.Object statemachine,
                java.lang.Object modelElement)
Set the Context of a statemachine.

Parameters:
statemachine - The state machine.
modelElement - The context.

addDeferrableEvent

void addDeferrableEvent(java.lang.Object state,
                        java.lang.Object deferrableEvent)
Add a deferrable event to a state.

Parameters:
state - The state.
deferrableEvent - The deferrable event.

removeDeferrableEvent

void removeDeferrableEvent(java.lang.Object state,
                           java.lang.Object deferrableEvent)
Remove a deferrable event from a state.

Parameters:
state - The state.
deferrableEvent - The referrable event.


ArgoUML © 1996-2006ArgoUML HomepageArgoUML Cookbook