public boolean runOptimize ( ) { boolean answer = false ; for ( int i = 0 ; i < this . highLowContainer . size ( ) ; i ++ ) { Container c = this . highLowContainer . getContainerAtIndex ( i ) . runOptimize ( ) ; if ( c instanceof RunContainer ) { answer = true ; } this . highLowContainer . setContainerAtIndex ( i , c ) ; } return answer ; }
Use a run - length encoding where it is more space efficient