de.fhg.igd.jhsm
Interface CompositeState

All Superinterfaces:
Component, State
All Known Implementing Classes:
HSM

public interface CompositeState
extends State

"A state that has substates - that is, nested states - is called a composite state" - Booch et al, The UML User Guide.

This adds the notion of hierarchy to state machines. A composite state can also be regarded as a state machine itself.

Version:
"$Id: CompositeState.java 1913 2007-08-08 02:41:53Z jpeters $"
Author:
Jan Haevecker

Method Summary
 void addState(State state)
          Adds a substate to this state.
 boolean contains(State state)
          Checks (recursively) wether the composite state or one of it's substates does have state as a substate.
 InitialState getInitialState()
          Returns the initial substate of the composite state.
 Set getStates()
          Returns all substates of the composite state.
 void removeState(State state)
          Removes a substate from this state.
 void setInitialState(InitialState initial)
          Sets the initial substate of the composite state.
 
Methods inherited from interface de.fhg.igd.jhsm.State
addDeferred, addTransition, defers, entry, exit, getDeferred, getTransitions, removeDeferred, removeTransition, setEntry, setExit
 
Methods inherited from interface de.fhg.igd.jhsm.Component
action, getAction, getName, getParent, setAction, setName, setParent
 

Method Detail

addState

public void addState(State state)
Adds a substate to this state.

Parameters:
state - The state that should be nested.

removeState

public void removeState(State state)
Removes a substate from this state.

Parameters:
state - The state that should be removed.

getInitialState

public InitialState getInitialState()
Returns the initial substate of the composite state.


setInitialState

public void setInitialState(InitialState initial)
Sets the initial substate of the composite state.


getStates

public Set getStates()
Returns all substates of the composite state.

Returns:
A set that contains all substates of the composite state.

contains

public boolean contains(State state)
Checks (recursively) wether the composite state or one of it's substates does have state as a substate.

Parameters:
state - The state that is the substate in question.
Returns:
true if the given state is contained in the composite state, false else.


Copyright © Fraunhofer Gesellschaft. All Rights Reserved.