private int combineSubsetBlocks ( Mode [ ] mode_type , int [ ] mode_length , int index_point ) { /* bring together same type blocks */ if ( index_point > 1 ) { for ( int i = 1 ; i < index_point ; i ++ ) { if ( mode_type [ i - 1 ] == mode_type [ i ] ) { /* bring together */ mode_length [ i - 1 ] = mode_length [ i - 1 ] + mode_length [ i ] ; /* decrease the list */ for ( int j = i + 1 ; j < index_point ; j ++ ) { mode_length [ j - 1 ] = mode_length [ j ] ; mode_type [ j - 1 ] = mode_type [ j ] ; } index_point -- ; i -- ; } } } return index_point ; }
Modifies the specified mode and length arrays to combine adjacent modes of the same type returning the updated index point .