|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object org.jtheque.core.managers.state.StateManager
public final class StateManager
A state manager implementation.
Constructor Summary | |
---|---|
StateManager()
|
Method Summary | ||
---|---|---|
void |
close()
Close the manager. |
|
|
createState(java.lang.Class<T> c)
Create and return a state. |
|
|
getOrCreateState(java.lang.Class<T> c)
Return the state of a certain class. |
|
|
getState(java.lang.Class<T> c)
Return the state of a certain class. |
|
void |
init()
Init the manager. |
|
void |
loadStates()
Load the states. |
|
void |
preInit()
Pre-init the manager. |
|
void |
registerState(IState state)
Register a new state. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public StateManager()
Method Detail |
---|
public void preInit()
IManager
preInit
in interface IManager
public void loadStates() throws ManagerException
loadStates
in interface IStateManager
ManagerException
- If an error occurs during the reading of the states.public void init() throws ManagerException
IManager
init
in interface IManager
ManagerException
- If an error occurs during the init process.public void close() throws ManagerException
IManager
close
in interface IManager
ManagerException
- If an error occurs during the close process.public <T extends IState> T getState(java.lang.Class<T> c)
IStateManager
getState
in interface IStateManager
T
- The state type.c
- The state class.
public <T extends IState> T getOrCreateState(java.lang.Class<T> c) throws StateException
IStateManager
getOrCreateState
in interface IStateManager
T
- The state type.c
- The state class.
StateException
- If an error occurs during the state getting.public <T extends IState> T createState(java.lang.Class<T> c) throws StateException
IStateManager
createState
in interface IStateManager
T
- The state type.c
- The state class.
StateException
- If an error occurs during the state creation.public void registerState(IState state)
IStateManager
registerState
in interface IStateManager
state
- The state to register.
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |