void changeState(int newState){
  int oldState;
synchronized (stateLock) {
    if (state == newState)     return;
    oldState=state;
    state=newState;
    stateLock.notifyAll();
  }
  sendStateChangeNotification(oldState,newState);
}

void changeState ( int newState ) { int oldState ; synchronized ( stateLock ) { if ( state == newState ) return ; oldState = state ; state = newState ; stateLock . notifyAll ( ) ; } sendStateChangeNotification ( oldState , newState ) ; }
for internal use only .
