|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--org.opencyc.conversation.FsmClass
Contains the attributes and behavior of a finite state machine instance.
Fsms have a class structure in which instances of a class have the
same arcs and states, with the exception that instances may have
differing actions and sub fsms on their arcs.
Subclass fsms inherit states and arcs from their superclass fsm.
A subclass fsm may override arcs which would otherwise be inherited.
Copyright 2001 Cycorp, Inc., license is open source GNU LGPL.
THIS SOFTWARE AND KNOWLEDGE BASE CONTENT ARE PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE OPENCYC ORGANIZATION OR ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE AND KNOWLEDGE BASE CONTENT, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
Field Summary | |
protected Performative |
defaultPerformative
default performative for the initial state |
protected java.util.HashMap |
fsmStates
dictionary of fsm states, stateName --> State |
protected State |
initialState
inital fsm state |
protected java.lang.String |
name
name of the fsm class |
protected FsmClass |
superClass
The fsm superClass or null for the root fsm class. |
Constructor Summary | |
protected |
FsmClass(java.lang.String name,
FsmClass superClass)
Constructs a new FsmClass object given the fsm name and superclass. |
protected |
FsmClass(java.lang.String name,
java.lang.String superClassName)
Constructs a new FsmClass object given the fsm name and superclass name. |
Method Summary | |
void |
addState(State fsmState)
Records the stateId and associated State |
void |
addState(java.lang.String stateId,
State fsmState)
Records the stateId and associated State |
Performative |
getDefaultPerformative()
Returns the default performative. |
State |
getInitialState()
Returns the initial fsm state. |
java.lang.String |
getName()
Returns the fsm name. |
State |
getState(java.lang.String stateId)
Returns the state having the given id. |
Fsm |
makeInstance(java.lang.String name)
Makes a new fsm instance of this fsm class. |
static Fsm |
makeInstance(java.lang.String name,
java.lang.String className)
Makes a new fsm instance of the fsm class name. |
FsmClass |
makeSubClass(java.lang.String name)
Makes a new fsm subclass of this fsm class. |
static FsmClass |
makeSubClass(java.lang.String name,
java.lang.String superClassName)
Makes a new fsm subclass of this fsm class name. |
void |
setDefaultPerformative(Performative defaultPerformative)
Sets the default performative. |
void |
setInitialState(State initialState)
Sets the initial fsm state. |
java.lang.String |
toString()
Returns a string representation of this object. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Field Detail |
protected java.lang.String name
protected FsmClass superClass
protected State initialState
protected Performative defaultPerformative
protected java.util.HashMap fsmStates
Constructor Detail |
protected FsmClass(java.lang.String name, FsmClass superClass)
name
- the fsm class namesuperClass
- the fsm superclassprotected FsmClass(java.lang.String name, java.lang.String superClassName)
name
- the fsm class namesuperClassName
- the fsm superclass nameMethod Detail |
public java.lang.String getName()
public void setInitialState(State initialState)
initialState
- the initial fsm statepublic State getInitialState()
public void setDefaultPerformative(Performative defaultPerformative)
defaultPerformative
- the default performative for the initial state, for those
cases in which the performative is computed, rather than input directly from the userpublic Performative getDefaultPerformative()
public void addState(State fsmState)
fsmState
- the FSM node identified by its stateIdpublic void addState(java.lang.String stateId, State fsmState)
stateId
- the given stateIdfsmState
- the FSM node identified by the stateIdpublic State getState(java.lang.String stateId)
stateId
- the state idpublic static FsmClass makeSubClass(java.lang.String name, java.lang.String superClassName)
name
- the name of the fsm subclassname
- the name of the fsm superclasspublic FsmClass makeSubClass(java.lang.String name)
name
- the name of the fsm subclasspublic static Fsm makeInstance(java.lang.String name, java.lang.String className)
name
- the name of the fsm instanceclassName
- the name of the fsm classpublic Fsm makeInstance(java.lang.String name)
name
- the name of the fsm instancepublic java.lang.String toString()
toString
in class java.lang.Object
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |