Class ComponentStateMachine<C,S>
java.lang.Object
io.github.astrapi69.design.pattern.state.component.ComponentStateMachine<C,S>
- Type Parameters:
C
- the generic type of the componentS
- the generic type of the current state
- Direct Known Subclasses:
AbstractJComponentStateMachine
The abstract class
ComponentStateMachine
can provide states on components. It manages the
current state of a component and defines abstract methods for updating the component state and
enabling/disabling the component. For an example, see the unit tests.-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected abstract void
setEnabled
(boolean enabled) Sets the enabled flag for the component.protected abstract void
Updates the state of the component.
-
Constructor Details
-
ComponentStateMachine
public ComponentStateMachine()
-
-
Method Details
-
updateComponentState
protected abstract void updateComponentState()Updates the state of the component. -
setEnabled
protected abstract void setEnabled(boolean enabled) Sets the enabled flag for the component.- Parameters:
enabled
- the enabled flag for the component
-