Analytical Perspectives in Game Design


 

All Packages  Class Hierarchy  This Package  Previous  Next  Index

Class bvyy.smf.StateMachine

java.lang.Object
   |
   +----bvyy.smf.StateMachine

public abstract class StateMachine
extends Object
implements Serializable, StateChangeListener
This is the class that allows a state change command to be created and then processed.

Intent

To allow the functioning of a state machine to appear as if it is just one class. This hides the internal represnetation of the state machine.

Motivation

I am not sure of the precise implementation of the state machine. This allows the interface to be defined, but the implementation to vary. For instance there is already a class for a linear state machine as opposed to a meshed-state state-machine.

Version:
1.0.2 24 May 1998
Author:
(c)1998 Brian Voon Yee Yap

Variable Index

 o changes
 o modifies
 o myName
 o vetos

Constructor Index

 o StateMachine()
The default constructor for this bean.
 o StateMachine(StringTokenizer)
Construct a state machine.

Method Index

 o addModifiableChangeListener(ModifiableChangeListener)
Add a ModifiableListener to the listener list.
 o addPropertyChangeListener(PropertyChangeListener)
Add a PropertyChangeListener to the listener list.
 o addVetoableChangeListener(VetoableChangeListener)
Add a VetoableListener to the listener list.
 o fireStateChange(ModifiableChangeEvent)
Change the state from the current state to a new state.
 o getName()
Get the name of this state machine.
 o getState()
Returns the current state of the state machine.
 o getStateTransitions()
Gets the states that can be reached from the current state.
 o removeModifiableChangeListener(ModifiableChangeListener)
Remove a ModifiableChangeListener from the listener list.
 o removePropertyChangeListener(PropertyChangeListener)
Remove a PropertyChangeListener from the listener list.
 o removeVetoableChangeListener(VetoableChangeListener)
Remove a VetoableChangeListener from the listener list.
 o setName(String)
Set the name of this state machine.

Variables

 o changes
 protected PropertyChangeSupport changes
 o vetos
 protected VetoableChangeSupport vetos
 o modifies
 protected ModifiableChangeSupport modifies
 o myName
 protected String myName

Constructors

 o StateMachine
 public StateMachine()
The default constructor for this bean.

 o StateMachine
 public StateMachine(StringTokenizer specification)
Construct a state machine.

Methods

 o getState
 public abstract String getState()
Returns the current state of the state machine.

 o getStateTransitions
 public abstract String getStateTransitions()
Gets the states that can be reached from the current state. An array of new states is returned.

 o addPropertyChangeListener
 public void addPropertyChangeListener(PropertyChangeListener l)
Add a PropertyChangeListener to the listener list.

 o removePropertyChangeListener
 public void removePropertyChangeListener(PropertyChangeListener l)
Remove a PropertyChangeListener from the listener list.

 o addVetoableChangeListener
 public void addVetoableChangeListener(VetoableChangeListener l)
Add a VetoableListener to the listener list.

 o removeVetoableChangeListener
 public void removeVetoableChangeListener(VetoableChangeListener l)
Remove a VetoableChangeListener from the listener list.

 o addModifiableChangeListener
 public void addModifiableChangeListener(ModifiableChangeListener l)
Add a ModifiableListener to the listener list.

 o removeModifiableChangeListener
 public void removeModifiableChangeListener(ModifiableChangeListener l)
Remove a ModifiableChangeListener from the listener list.

 o setName
 public void setName(String newName)
Set the name of this state machine.

Parameters:
newName - The name that will replace the existing name.
 o getName
 public String getName()
Get the name of this state machine.


All Packages  Class Hierarchy  This Package  Previous  Next  Index

22/11/99

 


See also: [Role Playing Games] [Game Engine]
© 1998, 1999 Brian Yap. These pages are available under the GNU licence.