public int growSuperNode ( ) { if ( getNumEntries ( ) < getCapacity ( ) ) { throw new IllegalStateException ( "This node is not yet overflowing (only " + getNumEntries ( ) + " of " + getCapacity ( ) + " entries)" ) ; } Entry [ ] old_nodes = super . entries . clone ( ) ; assert old_nodes [ old_nodes . length - 1 ] != null ; super . entries = ( Entry [ ] ) java . util . Arrays . copyOfRange ( old_nodes , 0 , getCapacity ( ) * 2 - 1 , entries . getClass ( ) ) ; assert super . entries . length == old_nodes . length * 2 - 1 ; return getCapacity ( ) ; }
Grows the supernode by duplicating its capacity .