org.apache.taglibs.rdc.scxml.model
Class State

java.lang.Object
  extended by org.apache.taglibs.rdc.scxml.model.TransitionTarget
      extended by org.apache.taglibs.rdc.scxml.model.State
All Implemented Interfaces:
Observable

public class State
extends TransitionTarget

The class in this SCXML object model that corresponds to the <state> SCXML element.

Author:
Rahul Akolkar, Jaroslav Gergic

Constructor Summary
State()
          Constructor
 
Method Summary
 void addChild(State state)
          Add a child state
 void addHistory(History h)
          This method is used by XML digester
 void addTransition(Transition transition)
          Add a transition to the map of all outgoing transitions for this state
 java.util.Map getChildren()
          Get the map of child states (may be empty)
 Context getContext()
          Get the Context
 java.util.List getHistory()
          Get the list of history pseudo states for this state
 Initial getInitial()
          Get the initial state
 boolean getIsFinal()
          Is this state a "final" state
 Parallel getParallel()
          Get the Parallel child (may be null)
 Transition getTransition(java.lang.String event)
          Get the map of all outgoing transitions from this state, which will be fired on the given event.
 java.util.Map getTransitions()
          Get the map of all outgoing transitions from this state
 java.util.List getTransitionsList()
          Get the outgoing transitions for this state as a java.util.List
 boolean hasHistory()
          Does this state have a history pseudo state
 boolean isComposite()
          Check whether this is a composite state (UML terminology)
 boolean isDone()
          In case this is a parallel state, check if one its final states is active.
 boolean isOrthogonal()
          Checks whether it is a orthogonal state, that is, it owns a parallel (UML terminology)
 boolean isRegion()
          Checks whether it is a region state (directly nested to parallel - UML terminology)
 boolean isSimple()
          Check whether this is a simple (leaf) state (UML terminology)
 void setContext(Context context)
          Set the Context
 void setDone(boolean done)
          Update the done property, which is set if this is a parallel state, and one its final states is active.
 void setInitial(Initial target)
          Set the initial state
 void setIsFinal(boolean isFinal)
          Set whether this is a "final" state
 void setParallel(Parallel parallel)
          Set the Parallel child
 
Methods inherited from class org.apache.taglibs.rdc.scxml.model.TransitionTarget
addListener, getId, getNotificationRegistry, getOnEntry, getOnExit, getParent, getParentState, removeListener, setId, setNotificationRegistry, setOnEntry, setOnExit, setParent
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

State

public State()
Constructor

Method Detail

getContext

public Context getContext()
Get the Context

Returns:
Returns the context.

setContext

public void setContext(Context context)
Set the Context

Parameters:
context - The context to set.

getIsFinal

public boolean getIsFinal()
Is this state a "final" state

Returns:
Returns the isFinal.

setIsFinal

public void setIsFinal(boolean isFinal)
Set whether this is a "final" state

Parameters:
isFinal - The isFinal to set.

getParallel

public Parallel getParallel()
Get the Parallel child (may be null)

Returns:
Returns the parallel.

setParallel

public void setParallel(Parallel parallel)
Set the Parallel child

Parameters:
parallel - The parallel to set.

getInitial

public Initial getInitial()
Get the initial state

Returns:
Returns the target.

setInitial

public void setInitial(Initial target)
Set the initial state

Parameters:
target - The target to set.

getTransitions

public java.util.Map getTransitions()
Get the map of all outgoing transitions from this state

Returns:
Returns the transitions Map.

getTransition

public Transition getTransition(java.lang.String event)
Get the map of all outgoing transitions from this state, which will be fired on the given event.

Returns:
Returns the transition for given event.

addTransition

public void addTransition(Transition transition)
Add a transition to the map of all outgoing transitions for this state

Parameters:
transition - The transitions to set.

getChildren

public java.util.Map getChildren()
Get the map of child states (may be empty)

Returns:
Returns the children.

addChild

public void addChild(State state)
Add a child state

Parameters:
state - a child state

getTransitionsList

public java.util.List getTransitionsList()
Get the outgoing transitions for this state as a java.util.List

Returns:
Returns the transitions (as a list). TODO - Check in next iteration whether both methods need to be retained.

addHistory

public void addHistory(History h)
This method is used by XML digester

Parameters:
h - History pseudo state

hasHistory

public boolean hasHistory()
Does this state have a history pseudo state

Returns:
true if a given state contains at least one history pseudo state

getHistory

public java.util.List getHistory()
Get the list of history pseudo states for this state

Returns:
a list of all history pseudo states contained by a given state (can be empty)
See Also:
hasHistory()

isSimple

public final boolean isSimple()
Check whether this is a simple (leaf) state (UML terminology)

Returns:
true if this is a simple state, otherwise false

isComposite

public final boolean isComposite()
Check whether this is a composite state (UML terminology)

Returns:
true if this is a composite state, otherwise false

isRegion

public final boolean isRegion()
Checks whether it is a region state (directly nested to parallel - UML terminology)

Returns:
true if this is a region state, otherwise false
See Also:
Parallel

isOrthogonal

public final boolean isOrthogonal()
Checks whether it is a orthogonal state, that is, it owns a parallel (UML terminology)

Returns:
true if this is a orthogonal state, otherwise false

isDone

public boolean isDone()
In case this is a parallel state, check if one its final states is active.

Returns:
Returns the done.

setDone

public void setDone(boolean done)
Update the done property, which is set if this is a parallel state, and one its final states is active.

Parameters:
done - The done to set.


Copyright ? 2000-2004 The Apache Software Foundation. All Rights Reserved.