"Cannot add Controller to an Unrealized Player");
}
// Enforce state reqs for this Player
if(currentState == Started) {
throw new ClockStartedError(
"Cannot add Controller to a Started Player");
}
int controllerState = newController.getState();
// Enforce state reqs for new controller
if( controllerState == Unrealized ||
controllerState == Realizing )
{
throw new NotRealizedError(
"Cannot add Unrealized Controller to a Player");
}
// Enforce state reqs for this Player
if(controllerState == Started) {
throw new ClockStartedError(
"Cannot add Started Controller to a Player");
}
// Set the time base for the new Controller. This may
// throw an IncompatibleTimeBaseException.