@ Override public int getMinPrefixLengthForBlock ( ) { int count = getDivisionCount ( ) ; int totalPrefix = getBitCount ( ) ; for ( int i = count - 1 ; i >= 0 ; i -- ) { AddressDivisionBase div = getDivision ( i ) ; int segBitCount = div . getBitCount ( ) ; int segPrefix = div . getMinPrefixLengthForBlock ( ) ; if ( segPrefix == segBitCount ) { break ; } else { totalPrefix -= segBitCount ; if ( segPrefix != 0 ) { totalPrefix += segPrefix ; break ; } } } return totalPrefix ; }
Returns the smallest prefix length possible such that this address division grouping includes the block of addresses for that prefix .