question: private boolean advanceApiBetweenOrLater ( TreeSet < AreaPanelInfo > sortedApiTree , AreaPanelInfo api , int minTime , int maxTime , int endTime ) { sortedApiTree . remove ( api ) ; AreaPanel ap = api . ap ( ) ; TimeTree rootTt = ap . getTimeTree ( ) ; TimeTree tt = rootTt . getEncompassigTimeTreeOrMaxTimeTreeBeforeTime ( maxTime , true ) ; if ( tt == null || tt . getMinTimeSecs ( ) < minTime ) { tt = rootTt . getEncompassigTimeTreeOrMinTimeTreeAfterTime ( maxTime , true ) ; if ( api . setTt ( tt , endTime ) ) { sortedApiTree . add ( api ) ; } return false ; } else { if ( api . setTt ( tt , endTime ) ) sortedApiTree . add ( api ) ; return true ; } }
target:  Advances the api to the latest time tree that is >= minTime and <= maxTime. If this is not possible, will advance even further to the earliest time after maxTime