void getLogicalToVisualRunsMap ( ) { if ( isGoodLogicalToVisualRunsMap ) { return ; } int count = countRuns ( ) ; if ( ( logicalToVisualRunsMap == null ) || ( logicalToVisualRunsMap . length < count ) ) { logicalToVisualRunsMap = new int [ count ] ; } int i ; long [ ] keys = new long [ count ] ; for ( i = 0 ; i < count ; i ++ ) { keys [ i ] = ( ( long ) ( runs [ i ] . start ) << 32 ) + i ; } Arrays . sort ( keys ) ; for ( i = 0 ; i < count ; i ++ ) { logicalToVisualRunsMap [ i ] = ( int ) ( keys [ i ] & 0x00000000FFFFFFFF ) ; } isGoodLogicalToVisualRunsMap = true ; }
Compute the logical to visual run mapping