|
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.BasicCpState
The BasicCpState class is a straightforward, vanilla-Java implementation of the CpState interface.
Fields inherited from interface com.ibm.conversation.CpState |
---|
IN_CHILD, NO_TYPE, NORMAL, TERMINAL, TYPE_STRINGS |
Constructor Summary | |
---|---|
BasicCpState(int newType)
Constructs a BasicCpState object of the given state type. |
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 transName)
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. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
public BasicCpState(int newType)
See CpState
for the list of allowed types.
newType
- The state type.Method Detail |
public int getType()
CpState
getType
in interface CpState
com.ibm.conversation.CpState
public java.lang.String getTypeString()
CpState
getTypeString
in interface CpState
com.ibm.conversation.CpState
public int getTypeFromString(java.lang.String str)
CpState
Does not change this state's type. (This method would be static, if static methods were allowed for interfaces.)
getTypeFromString
in interface CpState
com.ibm.conversation.CpState
str
- The string for the state type.public java.lang.String getName()
CpState
getName
in interface CpState
com.ibm.conversation.CpState
public void setName(java.lang.String newName)
CpState
setName
in interface CpState
com.ibm.conversation.CpState
newName
- The new name.public long getTimeoutInMillis()
CpState
The timeout value gives the amount of time that the conversation may remain in this state.
getTimeoutInMillis
in interface CpState
com.ibm.conversation.CpState
public void setTimeoutInMillis(long millis)
CpState
The timeout value gives the amount of time that the conversation may remain in this state.
setTimeoutInMillis
in interface CpState
com.ibm.conversation.CpState
millis
- The new timeout value, in milliseconds.public int getNumTransitions()
CpState
getNumTransitions
in interface CpState
com.ibm.conversation.CpState
public java.util.Collection getTransitions()
CpState
The elements of the Collection are type CpStateTransition
.
getTransitions
in interface CpState
com.ibm.conversation.CpState
public java.util.Collection getTransitionsWithSender(java.lang.String role)
CpState
The elements of the Collection are type CpStateTransition
.
getTransitionsWithSender
in interface CpState
com.ibm.conversation.CpState
role
- The role in question.public CpStateTransition getTransition(java.lang.String transName)
CpState
getTransition
in interface CpState
com.ibm.conversation.CpState
transId
- The transition name.null
if not found.public boolean addTransition(CpStateTransition newTrans)
CpState
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.
addTransition
in interface CpState
com.ibm.conversation.CpState
newTrans
- the transition to add.public boolean hasTransitionWithSender(java.lang.String role)
CpState
This is meaningful only for normal states.
hasTransitionWithSender
in interface CpState
com.ibm.conversation.CpState
public java.lang.String getChildPolicyName()
CpState
This is meaningful only for in-child states.
getChildPolicyName
in interface CpState
com.ibm.conversation.CpState
null
if there is none.public boolean setChildPolicyName(java.lang.String newName)
CpState
This is allowed only for in-child states.
setChildPolicyName
in interface CpState
com.ibm.conversation.CpState
newName
- The name of the child policy.public java.lang.String getChildPolicyRole(java.lang.String parentRole)
CpState
This is meaningful only for in-child states.
getChildPolicyRole
in interface CpState
com.ibm.conversation.CpState
parentRole
- The role in the current policy.null
if undefined.public boolean setChildPolicyRole(java.lang.String parentRole, java.lang.String childRole)
CpState
This is allowed only for in-child states.
setChildPolicyRole
in interface CpState
com.ibm.conversation.CpState
parentRole
- The role in the current policy.childRole
- The role in the child policy.public java.lang.String getReturnCode()
CpState
This is meaningful only for terminal states.
getReturnCode
in interface CpState
com.ibm.conversation.CpState
null
if undefined.public boolean setReturnCode(java.lang.String rc)
CpState
This is allowed only for terminal states.
setReturnCode
in interface CpState
com.ibm.conversation.CpState
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 |