|
ABLE 2.0.0 07/02/2003 10:25:01 | ||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--com.ibm.conversation.base.BasicCpStateMachine
The BasicCpStateMachine class is a straightforward, vanilla-Java implementation of the CpStateMachine interface.
Constructor Summary | |
---|---|
BasicCpStateMachine()
Constructs a BasicSpStateMachine object. |
Method Summary | |
---|---|
void |
addRole(java.lang.String newRole)
Adds the given role to the set of roles supported by the policy. |
void |
addState(CpState newState)
Adds the given state to the policy state machine. |
void |
clear()
Removes all roles, states, and transitions that have been added to this state machine. |
CpState |
getInitialState()
Returns the initial state of the policy. |
java.lang.String |
getInitialStateName()
Returns the name of the policy's initial state. |
int |
getNumStates()
Returns the number of states in the policy state machine. |
java.lang.String |
getPolicyName()
Returns the name of the policy. |
java.util.Collection |
getRoles()
Returns a Collection containing the roles supported by the policy. |
CpState |
getState(java.lang.String name)
Returns the state with the given name |
java.util.Collection |
getStates()
Returns a Collection containing all the states in the poliy state machine. |
CpStateTransition |
getTransition(java.lang.String stateName,
java.lang.String transitionName)
Returns the transition with the given transitionName whose source is the given stateName. |
static void |
main(java.lang.String[] args)
Unit test of BasicCpStateMachine. |
CpState |
newState(int stateType)
Creates and returns a new CpState of the given state type. |
CpStateTransition |
newTransition(int transitionType)
Creates and returns a new CpStateTransition of the given transition type. |
void |
setInitialStateName(java.lang.String newName)
Sets the name of the policy's initial state |
void |
setPolicyName(java.lang.String newName)
Sets the name of the policy. |
java.lang.String |
toString()
Returns a human-readable String representation of the state machine. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Constructor Detail |
public BasicCpStateMachine()
Method Detail |
public java.lang.String getPolicyName()
CpStateMachine
getPolicyName
in interface CpStateMachine
com.ibm.conversation.CpStateMachine
null
if undefined.public void setPolicyName(java.lang.String newName)
CpStateMachine
setPolicyName
in interface CpStateMachine
com.ibm.conversation.CpStateMachine
newName
- The new name of the policy.public java.util.Collection getRoles()
CpStateMachine
Each entry in the Collection is a String.
getRoles
in interface CpStateMachine
com.ibm.conversation.CpStateMachine
public void addRole(java.lang.String newRole)
CpStateMachine
addRole
in interface CpStateMachine
com.ibm.conversation.CpStateMachine
newRole
- The role to be added.public CpState getInitialState()
CpStateMachine
getInitialState
in interface CpStateMachine
com.ibm.conversation.CpStateMachine
null
if undefined.public java.lang.String getInitialStateName()
CpStateMachine
getInitialStateName
in interface CpStateMachine
com.ibm.conversation.CpStateMachine
null
if undefined.public void setInitialStateName(java.lang.String newName)
CpStateMachine
setInitialStateName
in interface CpStateMachine
com.ibm.conversation.CpStateMachine
newName
- The name of the new initial state.public int getNumStates()
CpStateMachine
getNumStates
in interface CpStateMachine
com.ibm.conversation.CpStateMachine
public java.util.Collection getStates()
CpStateMachine
Each entry in the Collection is a CpState
.
getStates
in interface CpStateMachine
com.ibm.conversation.CpStateMachine
public CpState getState(java.lang.String name)
CpStateMachine
getState
in interface CpStateMachine
com.ibm.conversation.CpStateMachine
name
- The state's name.null
if not found.public void addState(CpState newState)
CpStateMachine
addState
in interface CpStateMachine
com.ibm.conversation.CpStateMachine
newState
- The state to be added.public CpStateTransition getTransition(java.lang.String stateName, java.lang.String transitionName)
CpStateMachine
getTransition
in interface CpStateMachine
com.ibm.conversation.CpStateMachine
stateName
- The name of the source state.transitionName
- The name of the transition.null
if not found.public void clear()
CpStateMachine
clear
in interface CpStateMachine
public CpState newState(int stateType)
CpStateMachine
newState
in interface CpStateMachine
com.ibm.conversation.CpStateMachine
stateType
- The state type.for possible state types.
public CpStateTransition newTransition(int transitionType)
CpStateMachine
See CpStateTransition
for possible transition types.
newTransition
in interface CpStateMachine
com.ibm.conversation.CpStateMachine
transitionType
- The transition type.public java.lang.String toString()
This is defined for debugging porposes only. It uses BasicCpStateMachineWriter
to create the String.
toString
in class java.lang.Object
public static void main(java.lang.String[] args)
Reads a cpXML filename from the command line, parses the file using CpXmlParser
,
builds a BasicCpStateMachine, and prints its String representation to standard output.
args
- The command-line arguments. args[0] should be the cpXML filename.
|
ABLE 2.0.0 07/02/2003 10:25:01 | ||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |