org.jtheque.core.managers.state
Interface IStateManager

All Known Implementing Classes:
StateManager

public interface IStateManager

A state manager. It seems a manager who's responsible for the perstence of the states.

Author:
Baptiste Wicht

Method Summary
<T extends IState>
T
createState(java.lang.Class<T> c)
          Create and return a state.
<T extends IState>
T
getOrCreateState(java.lang.Class<T> c)
          Return the state of a certain class.
<T extends IState>
T
getState(java.lang.Class<T> c)
          Return the state of a certain class.
 void loadStates()
          Load the states.
 void registerState(IState state)
          Register a new state.
 

Method Detail

registerState

void registerState(IState state)
Register a new state.

Parameters:
state - The state to register.

getState

<T extends IState> T getState(java.lang.Class<T> c)
Return the state of a certain class.

Type Parameters:
T - The state type.
Parameters:
c - The state class.
Returns:
The state.

getOrCreateState

<T extends IState> T getOrCreateState(java.lang.Class<T> c)
                                  throws StateException
Return the state of a certain class. If the state has not been yet created, it would be created.

Type Parameters:
T - The state type.
Parameters:
c - The state class.
Returns:
The state.
Throws:
StateException - If an error occurs during the state getting.

createState

<T extends IState> T createState(java.lang.Class<T> c)
                             throws StateException
Create and return a state.

Type Parameters:
T - The state type.
Parameters:
c - The state class.
Returns:
The state.
Throws:
StateException - If an error occurs during the state creation.

loadStates

void loadStates()
                throws ManagerException
Load the states.

Throws:
ManagerException - If an error occurs during the state loading.


Copyright © 2009 JTheque. All Rights Reserved.