net.dpml.state
Class DefaultState

java.lang.Object
  extended bynet.dpml.state.DefaultState
All Implemented Interfaces:
Serializable, State

public class DefaultState
extends Object
implements State, Serializable

Default implementation of an application state descriptor.

Version:
1.0.1
Author:
Digital Product Meta Library
See Also:
Serialized Form

Field Summary
 
Fields inherited from interface net.dpml.state.State
NULL_STATE, TYPE
 
Constructor Summary
DefaultState()
          Creation of a new state.
DefaultState(String name)
          Creation of a new state.
DefaultState(String name, Trigger[] triggers, Transition[] transitions, Interface[] interfaces, Operation[] operations, State[] states)
          Creation of a new non-terminal state.
DefaultState(String name, Trigger[] triggers, Transition[] transitions, Interface[] interfaces, Operation[] operations, State[] states, boolean terminal)
          Creation of a new state.
 
Method Summary
 boolean equals(Object other)
          Compare this object to another for equality.
 Interface[] getInterfaces()
          Return the array of management interfaces associated with the state.
 String getName()
          Return the name of the state.
 Operation[] getOperations()
          Return the array of operations associated with the state.
 State getParent()
          Return the parent state to this state or null if this is the root of a state graph.
 State[] getStatePath()
          Return the state path.
 State[] getStates()
          Return the substates within this state.
 boolean getTerminal()
          Return the terminal flag.
 Transition[] getTransitions()
          Return the array of transtions associated with the state.
 Trigger[] getTriggers()
          Return the array of triggers associated with the state.
 int hashCode()
          Compute the hashcode for this instance.
 boolean isTerminal()
          Test is the state is a terminal state.
 void setParent(State state)
          Set the parent state.
 String toString()
          Return a string representation of the instance.
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 

Constructor Detail

DefaultState

public DefaultState()
Creation of a new state.


DefaultState

public DefaultState(String name)
Creation of a new state.

Parameters:
name - the state name

DefaultState

public DefaultState(String name,
                    Trigger[] triggers,
                    Transition[] transitions,
                    Interface[] interfaces,
                    Operation[] operations,
                    State[] states)
Creation of a new non-terminal state.

Parameters:
name - the state name
triggers - an array of triggers
transitions - an array of state transitions
interfaces - an array of management interface declarations
operations - an array of operations
states - an array of substates

DefaultState

public DefaultState(String name,
                    Trigger[] triggers,
                    Transition[] transitions,
                    Interface[] interfaces,
                    Operation[] operations,
                    State[] states,
                    boolean terminal)
Creation of a new state.

Parameters:
name - the state name
triggers - an array of triggers
transitions - an array of state transitions
interfaces - an array of management interface declarations
operations - an array of operations
states - an array of substates
terminal - the terminal flag
Method Detail

getParent

public State getParent()
Return the parent state to this state or null if this is the root of a state graph.

Specified by:
getParent in interface State
Returns:
the parent state

setParent

public void setParent(State state)
Set the parent state.

Specified by:
setParent in interface State
Parameters:
state - the parent state

getName

public String getName()
Return the name of the state.

Specified by:
getName in interface State
Returns:
the state name

getTriggers

public Trigger[] getTriggers()
Return the array of triggers associated with the state.

Specified by:
getTriggers in interface State
Returns:
the trigger array

getStatePath

public State[] getStatePath()
Return the state path. The path is composed of a sequence of states from the root to this state.

Specified by:
getStatePath in interface State
Returns:
the state path

getStates

public State[] getStates()
Return the substates within this state.

Specified by:
getStates in interface State
Returns:
the substate array

getTransitions

public Transition[] getTransitions()
Return the array of transtions associated with the state.

Specified by:
getTransitions in interface State
Returns:
the transition array

getOperations

public Operation[] getOperations()
Return the array of operations associated with the state.

Specified by:
getOperations in interface State
Returns:
the operation array

getInterfaces

public Interface[] getInterfaces()
Return the array of management interfaces associated with the state.

Specified by:
getInterfaces in interface State
Returns:
the interfaces array

getTerminal

public boolean getTerminal()
Return the terminal flag.

Returns:
true if terminal

isTerminal

public boolean isTerminal()
Test is the state is a terminal state.

Specified by:
isTerminal in interface State
Returns:
true if terminal

toString

public String toString()
Return a string representation of the instance.

Returns:
the string value

equals

public boolean equals(Object other)
Compare this object to another for equality.

Parameters:
other - the other object
Returns:
true if the object is equal to this object

hashCode

public int hashCode()
Compute the hashcode for this instance.

Returns:
the hashcode value