All Packages Class Hierarchy This Package Previous Next Index
Class bvyy.smf.ContinuousLinearStateModel
java.lang.Object
|
+----bvyy.smf.StateMachine
|
+----bvyy.smf.ContinuousLinearStateModel
- public class ContinuousLinearStateModel
- extends StateMachine
This class is provides an "infinitely" variable linear state model. In all
respects it is the respects is is the same as a Discrte Linear State Model.
- Version:
- 0.0.1 21 June 1998
- Author:
- (c)1998 Brian Voon Yee Yap
- See Also:
- DiscreteLinearStateModel
-
ContinuousLinearStateModel()
-
-
ContinuousLinearStateModel(String)
- Construct a state machine.
-
fireStateChange(ModifiableChangeEvent)
- Change the state from the current state to a new state.
-
getDefaultValue()
- Get the default value.
-
getDownVerb()
- Gets the down verb.
-
getMax()
- Get maximum value
-
getMin()
- Get minimum value
-
getState()
- Returns the current state of the state machine in a StringTokenizer.
-
getStateTransitions()
- Gets the states that can be reached from the current state.
-
getUpVerb()
- Gets the up verb.
-
setDefaultValue(float)
- Set the default value.
-
setDownVerb(String)
- Sets the down verb.
-
setMax(float)
- Set maximum value.
-
setMin(float)
- Set minimum value.
If the current value, or default values are less than the new minimum
they will be set to the new minimum.
-
setUpVerb(String)
- Sets the up verb.
ContinuousLinearStateModel
public ContinuousLinearStateModel()
ContinuousLinearStateModel
public ContinuousLinearStateModel(String spec)
- Construct a state machine.
This method is synchronised to prevent conflicts from other clients who
might want to update the state of this machine. They will have to wait until
after the object is created.
- Parameters:
- spec - The format of the input token shall be:
- LSM,[major version],[minor version]
- name
- defaultvalue
- maxValue
- minvalue
- upVerb
- downVerb
The delimeter is |.
fireStateChange
public void fireStateChange(ModifiableChangeEvent newState) throws PropertyVetoException
- Change the state from the current state to a new state. If the state
request is not possible then no transition happens. This might happen in a
multi-user game where another user has acted just before this user.
Modifiers are not implemented in this version.
- Parameters:
- newState - is a property change event. The old and new value objects
should be string objects.
- Throws: PropertyVetoException
- thrown if a vetoable listener vetoes the
change.
- Overrides:
- fireStateChange in class StateMachine
getState
public String getState()
- Returns the current state of the state machine in a StringTokenizer.
The format of the StringTokenizer is:
- myName,[major version],[minor version]
- myvalue
- Overrides:
- getState in class StateMachine
getStateTransitions
public String getStateTransitions()
- Gets the states that can be reached from the current state. A
StringTokenizer of new states is returned.
The format of the StringTokenizer is:
- LSM,[major version],[minor version]
- name
- currentvalue
- maxValue
- minvalue
- upVerb
- downVerb
The delimeter is "|".
- Overrides:
- getStateTransitions in class StateMachine
setDefaultValue
public void setDefaultValue(float newDefault)
- Set the default value.
- Parameters:
- newDefault - The default is set to this value unless it is outside the
maximum or minimum value. The it is set to the maximum
or minimum value.
getDefaultValue
public float getDefaultValue()
- Get the default value.
setMax
public void setMax(float newMax)
- Set maximum value.
If the current value, or default values are greater than the new maximum
they will be set to the new maximum. This in turn will fire any necessary
validations. If this change is voided, then nothing is done.
If the maxvalue is below the minimum value then the maximum value will be
set to the minimum value.
- Parameters:
- newMax - The new maximum value.
getMax
public float getMax()
- Get maximum value
setMin
public void setMin(float newMin)
- Set minimum value.
If the current value, or default values are less than the new minimum
they will be set to the new minimum. This in turn will fire any necessary
validations. If this change is voided, then nothing is done.
If you attempt to set the minimum above the maximum, it will be set to the
maximum.
- Parameters:
- newMin - The new minimum value.
getMin
public float getMin()
- Get minimum value
setUpVerb
public void setUpVerb(String newUpVerb)
- Sets the up verb.
- Parameters:
- newUpVerb - the new verb.
getUpVerb
public String getUpVerb()
- Gets the up verb.
setDownVerb
public void setDownVerb(String newDownVerb)
- Sets the down verb.
- Parameters:
- newDownVerb - the new verb.
getDownVerb
public String getDownVerb()
- Gets the down verb.
All Packages Class Hierarchy This Package Previous Next Index
|