java.lang.Object
org.monte.media.player.StateTracker
- All Implemented Interfaces:
EventListener,StateListener
Tracks state changes in a StateModel.
- Author:
- Werner Randelshofer, Hausmatt 10, CH-6405 Goldau, Switzerland
-
Constructor Summary
ConstructorsConstructorDescriptionStateTracker(StateModel model) Creates a StateTracker for the indicated StateModel. -
Method Summary
Modifier and TypeMethodDescriptionvoidsetStateModel(StateModel model) Sets the StateModel.voidstateChanged(StateEvent event) XXX This method is public as an implementation side effect.voidwaitForState(int state) Waits until the StateModel reaches the indicated state.intwaitForState(int[] states) Waits until the StateModel reaches one of the indicated states.
-
Constructor Details
-
StateTracker
Creates a StateTracker for the indicated StateModel.- Parameters:
model- The model to be tracked.
-
-
Method Details
-
setStateModel
Sets the StateModel. Note: This method must not be called while one of the waitForState methods is working.- Parameters:
model- StateModel to be tracked.
-
waitForState
public void waitForState(int state) Waits until the StateModel reaches the indicated state. Note: waitForState methods may not be called from multiple threads simoultaneously.- Parameters:
state- to wait for.
-
waitForState
public int waitForState(int[] states) Waits until the StateModel reaches one of the indicated states.Note: waitForState methods may not be called from multiple threads simoultaneously.
- Parameters:
states- choice of states to wait for.
-
stateChanged
XXX This method is public as an implementation side effect. " Do not call or override.- Specified by:
stateChangedin interfaceStateListener
-