@ Override public Integer getPrefixLengthForSingleBlock ( ) { int count = getDivisionCount ( ) ; int totalPrefix = 0 ; for ( int i = 0 ; i < count ; i ++ ) { AddressDivisionBase div = getDivision ( i ) ; Integer divPrefix = div . getPrefixLengthForSingleBlock ( ) ; if ( divPrefix == null ) { return null ; } totalPrefix += divPrefix ; if ( divPrefix < div . getBitCount ( ) ) { //remaining segments must be full range or we return null for ( i ++ ; i < count ; i ++ ) { AddressDivisionBase laterDiv = getDivision ( i ) ; if ( ! laterDiv . isFullRange ( ) ) { return null ; } } } } return cacheBits ( totalPrefix ) ; }
Returns a prefix length for which the range of this segment grouping matches the the block of addresses for that prefix .