private int getLRDefinedWindow ( ) { int leastRU = Integer . MAX_VALUE ; int whichWindow = INVALIDWINDOW ; // find least recently used window // supposedly faster to count down //for( int i = 0; i < NUMWINDOWS; i++ ) { for ( int i = NUMWINDOWS - 1 ; i >= 0 ; -- i ) { if ( fTimeStamps [ i ] < leastRU ) { leastRU = fTimeStamps [ i ] ; whichWindow = i ; } } return whichWindow ; }
Find the least - recently defined window