fm.liveswitch.DataChannelStateMachine Class Reference

A state machine for data channel states. More...

Public Member Functions

 DataChannelStateMachine ()
 Initializes a new instance of the fm.liveswitch.DataChannelStateMachine class. More...
 
- Public Member Functions inherited from fm.liveswitch.StateMachine< fm.liveswitch.DataChannelState >
void addTransition (T fromState, T toState)
 Adds an allowed transition. More...
 
boolean canTransition (T toState)
 Determines whether a transition to the specified state is allowed. More...
 
long getLastStateMillis ()
 Gets the length of time spent in the last state, in milliseconds. More...
 
long getLastStateTicks ()
 Gets the length of time spent in the last state, in ticks. More...
 
getState ()
 Gets the state. More...
 
long getSystemTimestamp ()
 Gets the system timestamp of the last state transition. More...
 
boolean isReachable (T state)
 Determines whether a transition to a specified state is possible (even via intermediate hops). More...
 
 StateMachine (T initialState)
 Initializes a new instance of the fm.liveswitch.StateMachine class. More...
 
boolean transition (T toState)
 Transitions to the specified state. More...
 

Protected Member Functions

int stateToValue (fm.liveswitch.DataChannelState state)
 Converts a state to an integer value. More...
 
fm.liveswitch.DataChannelState valueToState (int value)
 Converts an integer value to a state. More...
 
- Protected Member Functions inherited from fm.liveswitch.StateMachine< fm.liveswitch.DataChannelState >
int getStateValue ()
 Gets the state value. More...
 
abstract int stateToValue (T state)
 Converts a state to an integer value. More...
 
abstract T valueToState (int value)
 Converts an integer value to a state. More...
 

Detailed Description

A state machine for data channel states.

Constructor & Destructor Documentation

◆ DataChannelStateMachine()

fm.liveswitch.DataChannelStateMachine.DataChannelStateMachine ( )

Initializes a new instance of the fm.liveswitch.DataChannelStateMachine class.

Member Function Documentation

◆ stateToValue()

int fm.liveswitch.DataChannelStateMachine.stateToValue ( fm.liveswitch.DataChannelState  state)
protected

Converts a state to an integer value.

Parameters
stateThe state.

◆ valueToState()

fm.liveswitch.DataChannelState fm.liveswitch.DataChannelStateMachine.valueToState ( int  value)
protected

Converts an integer value to a state.

Parameters
valueThe integer value.