public static long mixTimeSpanAndPointInTime ( long loadTime , long refreshAfter , long pointInTime ) { long _refreshTime = loadTime + refreshAfter ; if ( _refreshTime < 0 ) { _refreshTime = ETERNAL ; } if ( pointInTime == ETERNAL ) { return _refreshTime ; } if ( pointInTime > _refreshTime ) { return _refreshTime ; } long _absPointInTime = Math . abs ( pointInTime ) ; if ( _absPointInTime <= _refreshTime ) { return pointInTime ; } long _pointInTimeMinusDelta = _absPointInTime - refreshAfter ; if ( _pointInTimeMinusDelta < _refreshTime ) { return _pointInTimeMinusDelta ; } return _refreshTime ; }
Combine a refresh time span and an expiry at a specified point in time .