public synchronized void setState(int state) { if (this.state != state) { for (StateObserver observer : observers) { observer.onChangeState(this.state, state, targetList); } this.state = state; if (this.state == STOP) { targetList.clear(); } } }
public synchronized void scroll(Motion motion) { for (StateObserver observer : observers) { observer.scroll(motion); } }