/** * Detaches the state from the AppStateManager. * * @param state The state to detach * @return True if the state was detached successfully, false * if the state was not attached in the first place. */ public boolean detach(AppState state){ synchronized (states){ if (states.contains(state)){ state.stateDetached(this); states.remove(state); terminating.add(state); return true; } else if(initializing.contains(state)){ state.stateDetached(this); initializing.remove(state); return true; }else{ return false; } } }
/** * Detaches the state from the AppStateManager. * * @param state The state to detach * @return True if the state was detached successfully, false * if the state was not attached in the first place. */ public boolean detach(AppState state){ synchronized (states){ if (states.contains(state)){ state.stateDetached(this); states.remove(state); terminating.add(state); return true; } else if(initializing.contains(state)){ state.stateDetached(this); initializing.remove(state); return true; }else{ return false; } } }
/** * Detaches the state from the AppStateManager. * * @param state The state to detach * @return True if the state was detached successfully, false * if the state was not attached in the first place. */ public boolean detach(AppState state){ synchronized (states){ if (states.contains(state)){ state.stateDetached(this); states.remove(state); terminating.add(state); return true; } else if(initializing.contains(state)){ state.stateDetached(this); initializing.remove(state); return true; }else{ return false; } } }