lnsc.page
Class AbstractActionGenerator
java.lang.Object
|
+--lnsc.page.AbstractActionGenerator
- All Implemented Interfaces:
- ActionGenerator
- public abstract class AbstractActionGenerator
- extends java.lang.Object
- implements ActionGenerator
Optional basis for class implementing ActionGenerator
interface.
Derived classes constructor must fill the protected variables and implement
ActionGenerator.getActions(lnsc.page.State)
and getActionsEnumerator(lnsc.page.State)
. Default
implementation for getActionsEnumerator(lnsc.page.State)
uses ActionGenerator.getActions(lnsc.page.State)
.
Method Summary |
boolean |
areActionsFixed()
Indicates whether the list of actions is fixed (always the same) or not. |
int |
getActionCount()
Indicates how many actions it generates. |
java.util.Enumeration |
getActionsEnumerator(State s)
Returns an iterator that list the available actions from the current state. |
Methods inherited from class java.lang.Object |
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
AbstractActionGenerator
public AbstractActionGenerator()
areActionsFixed
public boolean areActionsFixed()
- Description copied from interface:
ActionGenerator
- Indicates whether the list of actions is fixed (always the same) or not.
- Specified by:
areActionsFixed
in interface ActionGenerator
- Returns:
- true if the list of action is independent of the state,
false otherwise
getActionCount
public int getActionCount()
- Description copied from interface:
ActionGenerator
- Indicates how many actions it generates. For fixed it should return the
number of actions, for unfixed, it should return -1.
- Specified by:
getActionCount
in interface ActionGenerator
- Returns:
- Number of actions.
getActionsEnumerator
public java.util.Enumeration getActionsEnumerator(State s)
- Description copied from interface:
ActionGenerator
- Returns an iterator that list the available actions from the current state.
- Specified by:
getActionsEnumerator
in interface ActionGenerator
- Returns:
- The actions enumerator.