|
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 |
The CpState interface represents a state in a CpStateMachine.
There are three types of state:
Connectivity constraints: There are constraints on the way in which states and
transitions are connected togehter. See CpStateTransition
for details.
This a fat interface for all state types. It was done this way, rather than as a base interface and three sub-interfaces, because of the relative simplicity of the state's API.
Field Summary | |
---|---|
static int |
IN_CHILD
The state type for in-child states. |
static int |
NO_TYPE
The state type for states whose type has not been set. |
static int |
NORMAL
The state type for normal states. |
static int |
TERMINAL
The state type for terminal states. |
static java.lang.String[] |
TYPE_STRINGS
Strings for each of the state types. |
Method Summary | |
---|---|
boolean |
addTransition(CpStateTransition newTrans)
Attempts to add the given transition to this state's transitions. |
java.lang.String |
getChildPolicyName()
Returns the name of the child policy to be loaded when this state is entered. |
java.lang.String |
getChildPolicyRole(java.lang.String parentRole)
Returns the role of the child conversation policy which will be played by the agent that is playing the given role in the current conversation policy (i.e., the conversation policy of which this CpState is a state). |
java.lang.String |
getName()
Returns the state's name. |
int |
getNumTransitions()
Returns the number of transitions from this state (i.e., its out-degree). |
java.lang.String |
getReturnCode()
Returns the state's return code. |
long |
getTimeoutInMillis()
Returns the state's timeout value. |
CpStateTransition |
getTransition(java.lang.String transId)
Returns the transition with the given name. |
java.util.Collection |
getTransitions()
Returns a Collection containing this state's transitions. |
java.util.Collection |
getTransitionsWithSender(java.lang.String role)
Returns a Collection containing all of the transitions for which the given role is the sender of a message. |
int |
getType()
Returns the states's type. |
int |
getTypeFromString(java.lang.String str)
Returns the state type matching the given string. |
java.lang.String |
getTypeString()
Returns a string corresponding to the state's type. |
boolean |
hasTransitionWithSender(java.lang.String role)
Indicates whether this state has a transition in which the given role sends a message. |
boolean |
setChildPolicyName(java.lang.String newName)
Attempts to set the name of the child policy to be loaded when this state is entered. |
boolean |
setChildPolicyRole(java.lang.String parentRole,
java.lang.String childRole)
Sets the role that will be played, in the child policy, by the agent that plays the given role in the current policy. |
void |
setName(java.lang.String newName)
Sets the state's name. |
boolean |
setReturnCode(java.lang.String rc)
Sets the state's return code. |
void |
setTimeoutInMillis(long millis)
Sets the state's timeout value. |
Field Detail |
public static final int NO_TYPE
public static final int NORMAL
public static final int IN_CHILD
public static final int TERMINAL
public static final java.lang.String[] TYPE_STRINGS
This is public as a side-effect of the design, but the values shouldn't be accessed
directly. Use getTypeString()
or getTypeFromString()
instead.
Method Detail |
public int getType()
public java.lang.String getTypeString()
public int getTypeFromString(java.lang.String str)
Does not change this state's type. (This method would be static, if static methods were allowed for interfaces.)
str
- The string for the state type.public java.lang.String getName()
public void setName(java.lang.String newName)
newName
- The new name.public long getTimeoutInMillis()
The timeout value gives the amount of time that the conversation may remain in this state.
public void setTimeoutInMillis(long millis)
The timeout value gives the amount of time that the conversation may remain in this state.
millis
- The new timeout value, in milliseconds.public int getNumTransitions()
public java.util.Collection getTransitions()
The elements of the Collection are type CpStateTransition
.
public java.util.Collection getTransitionsWithSender(java.lang.String role)
The elements of the Collection are type CpStateTransition
.
role
- The role in question.public CpStateTransition getTransition(java.lang.String transId)
transId
- The transition name.null
if not found.public boolean addTransition(CpStateTransition newTrans)
In order for the transition to be added, it must obey the connectivity constraints
that determine what types of transition may be added to each type of state.
See CpStateTransition
for more information.
newTrans
- the transition to add.public boolean hasTransitionWithSender(java.lang.String role)
This is meaningful only for normal states.
public java.lang.String getChildPolicyName()
This is meaningful only for in-child states.
null
if there is none.public boolean setChildPolicyName(java.lang.String newName)
This is allowed only for in-child states.
newName
- The name of the child policy.public java.lang.String getChildPolicyRole(java.lang.String parentRole)
This is meaningful only for in-child states.
parentRole
- The role in the current policy.null
if undefined.public boolean setChildPolicyRole(java.lang.String parentRole, java.lang.String childRole)
This is allowed only for in-child states.
parentRole
- The role in the current policy.childRole
- The role in the child policy.public java.lang.String getReturnCode()
This is meaningful only for terminal states.
null
if undefined.public boolean setReturnCode(java.lang.String rc)
This is allowed only for terminal states.
rc
- The return code.
|
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 |