public synchronized void update(){
  if (frames.size() > 1) {
    animTime+=1;
    if (animTime >= totalDuration) {
      animTime=animTime % totalDuration;
      currFrameIndex=0;
    }
    while (animTime > getFrame(currFrameIndex).endTime) {
      currFrameIndex++;
    }
  }
}

public synchronized void update ( ) { if ( frames . size ( ) > 1 ) { animTime += 1 ; if ( animTime >= totalDuration ) { animTime = animTime % totalDuration ; currFrameIndex = 0 ; } while ( animTime > getFrame ( currFrameIndex ) . endTime ) { currFrameIndex ++ ; } } }
updates this animation ' s current image ( frame ) , if necessary .
