EnumState
- public class MachineState<EnumState> extends Object
Constructor and Description |
---|
MachineState(EnumState initialState)
Initialize with an initialState but no association (Machine State is empty)
|
MachineState(EnumState initialState,
ConcurrentHashMap<EnumState,EnumSet<?>> map)
Initialize with an initialState
|
Modifier and Type | Method and Description |
---|---|
EnumSet<?> |
addNewAssociation(EnumState state,
EnumSet<?> set)
Add a new association from one state to a set of acceptable following states (can replace an
existing association)
|
EnumSet<?> |
addNewAssociation(Transition<EnumState> elt)
Add a new association from one state to a set of acceptable following states (can replace an
existing association)
|
EnumState |
getCurrent()
Return the current application state.
|
void |
release()
Release the Machine State
|
EnumSet<?> |
removeAssociation(EnumState state)
Remove an association from one state to any acceptable following states
|
EnumState |
setCurrent(EnumState desiredState)
Sets the current application state.
|
EnumState |
setDryCurrent(EnumState desiredState)
Sets the current application state, but no exception if not compatible.
|
public MachineState(EnumState initialState, ConcurrentHashMap<EnumState,EnumSet<?>> map)
initialState
- initial MachineStatemap
- the association of state and set of acceptable following statespublic MachineState(EnumState initialState)
initialState
- initial MachineStatepublic EnumSet<?> addNewAssociation(EnumState state, EnumSet<?> set)
state
- set
- the new associationpublic EnumSet<?> addNewAssociation(Transition<EnumState> elt)
elt
- public EnumSet<?> removeAssociation(EnumState state)
state
- the state to remove any acceptable following statespublic EnumState getCurrent()
public EnumState setCurrent(EnumState desiredState) throws IllegalFiniteStateException
desiredState
- IllegalFiniteStateException
- if the state is not allowedpublic EnumState setDryCurrent(EnumState desiredState)
desiredState
- public void release()
Copyright © 2009–2019 Waarp. All rights reserved.