public void increment ( int level ) { assert level >= 1 ; if ( this . numbers . size ( ) < level ) { do { this . numbers . addLast ( 0 ) ; } while ( this . numbers . size ( ) < level ) ; } else if ( this . numbers . size ( ) > level ) { do { this . numbers . removeLast ( ) ; } while ( this . numbers . size ( ) > level ) ; } assert this . numbers . size ( ) == level ; final int previousSection = this . numbers . removeLast ( ) ; this . numbers . addLast ( previousSection + 1 ) ; }
Change this version number by incrementing the number for the given level .