org.apache.commons.scxml.model
Class State

java.lang.Object
  extended by org.apache.commons.scxml.model.TransitionTarget
      extended by org.apache.commons.scxml.model.State
All Implemented Interfaces:
java.io.Serializable
Direct Known Subclasses:
Final

public class State
extends TransitionTarget

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

See Also:
Serialized Form

Constructor Summary
State()
          Constructor.
 
Method Summary
 void addChild(State state)
          Deprecated. Use addChild(TransitionTarget) instead.
 void addChild(TransitionTarget tt)
          Add a child transition target.
 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).
 Initial getInitial()
          Get the initial state.
 Invoke getInvoke()
          Get the Invoke child (may be null).
 boolean getIsFinal()
          Deprecated. Use isFinal() instead
 Parallel getParallel()
          Deprecated. <parallel> no longer needs an enclosing <state> element.
 java.util.Map getTransitions()
          Deprecated. Use getTransitionsList() instead
 java.util.List getTransitionsList()
          Get the outgoing transitions for this state as a java.util.List.
 java.util.List getTransitionsList(java.lang.String event)
          Get the list of all outgoing transitions from this state, that will be candidates for being fired on the given event.
 boolean isComposite()
          Check whether this is a composite state (UML terminology).
 boolean isDone()
          Deprecated. Will be removed in v1.0, in favor of SCInstance#isDone(TransitionTarget)
 boolean isFinal()
          Is this state a "final" state.
 boolean isOrthogonal()
          Deprecated. <parallel> now represents an orthogonal state, rather than denoting that the enclosing state is orthogonal, as it did in previous SCXML WDs.
 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 setDone(boolean done)
          Deprecated. Will be removed in v1.0, in favor of SCInstance#setDone(TransitionTarget)
 void setFinal(boolean isFinal)
          Set whether this is a "final" state.
 void setInitial(Initial target)
          Set the initial state.
 void setInvoke(Invoke invoke)
          Set the Invoke child.
 void setIsFinal(boolean isFinal)
          Deprecated. Use setFinal(boolean) instead
 void setParallel(Parallel parallel)
          Deprecated. <parallel> no longer needs an enclosing <state> element.
 
Methods inherited from class org.apache.commons.scxml.model.TransitionTarget
addHistory, getDatamodel, getHistory, getId, getOnEntry, getOnExit, getParent, getParentState, hasHistory, setDatamodel, setId, 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

getIsFinal

public final boolean getIsFinal()
Deprecated. Use isFinal() instead

Is this state a "final" state.

Returns:
boolean Returns the isFinal.

setIsFinal

public final void setIsFinal(boolean isFinal)
Deprecated. Use setFinal(boolean) instead

Set whether this is a "final" state.

Parameters:
isFinal - The isFinal to set.

isFinal

public final boolean isFinal()
Is this state a "final" state.

Returns:
boolean Returns the isFinal.
Since:
0.7

setFinal

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

Parameters:
isFinal - The isFinal to set.
Since:
0.7

getParallel

public final Parallel getParallel()
Deprecated. <parallel> no longer needs an enclosing <state> element.

Get the Parallel child (may be null).

Returns:
Parallel Returns the parallel.

setParallel

public final void setParallel(Parallel parallel)
Deprecated. <parallel> no longer needs an enclosing <state> element.

Set the Parallel child.

Parameters:
parallel - The parallel to set.

getInvoke

public final Invoke getInvoke()
Get the Invoke child (may be null).

Returns:
Invoke Returns the invoke.

setInvoke

public final void setInvoke(Invoke invoke)
Set the Invoke child.

Parameters:
invoke - The invoke to set.

getInitial

public final Initial getInitial()
Get the initial state.

Returns:
Initial Returns the initial state.

setInitial

public final void setInitial(Initial target)
Set the initial state.

Parameters:
target - The target to set.

getTransitions

public final java.util.Map getTransitions()
Deprecated. Use getTransitionsList() instead

Get the map of all outgoing transitions from this state.

Returns:
Map Returns the transitions Map.

getTransitionsList

public final java.util.List getTransitionsList(java.lang.String event)
Get the list of all outgoing transitions from this state, that will be candidates for being fired on the given event.

Parameters:
event - The event
Returns:
List Returns the candidate transitions for given event

addTransition

public final 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 final java.util.Map getChildren()
Get the map of child states (may be empty).

Returns:
Map Returns the children.

addChild

public final void addChild(State state)
Deprecated. Use addChild(TransitionTarget) instead.

Add a child state.

Parameters:
state - a child state

addChild

public final void addChild(TransitionTarget tt)
Add a child transition target.

Parameters:
tt - a child transition target
Since:
0.7

getTransitionsList

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

Returns:
List Returns the transitions list.

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()
Deprecated. <parallel> now represents an orthogonal state, rather than denoting that the enclosing state is orthogonal, as it did in previous SCXML WDs.

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 final boolean isDone()
Deprecated. Will be removed in v1.0, in favor of SCInstance#isDone(TransitionTarget)

In case this is a parallel state, check if one its final states is active.

Returns:
Returns the done.

setDone

public final void setDone(boolean done)
Deprecated. Will be removed in v1.0, in favor of SCInstance#setDone(TransitionTarget)

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 © 2005-2008 The Apache Software Foundation. All Rights Reserved.