@ Override public boolean containsPrefixBlock ( int prefixLength ) { checkSubnet ( this , prefixLength ) ; int divisionCount = getDivisionCount ( ) ; int prevBitCount = 0 ; for ( int i = 0 ; i < divisionCount ; i ++ ) { AddressDivision division = getDivision ( i ) ; int bitCount = division . getBitCount ( ) ; int totalBitCount = bitCount + prevBitCount ; if ( prefixLength < totalBitCount ) { int divPrefixLen = Math . max ( 0 , prefixLength - prevBitCount ) ; if ( ! division . isPrefixBlock ( division . getDivisionValue ( ) , division . getUpperDivisionValue ( ) , divPrefixLen ) ) { return false ; } for ( ++ i ; i < divisionCount ; i ++ ) { division = getDivision ( i ) ; if ( ! division . isFullRange ( ) ) { return false ; } } return true ; } prevBitCount = totalBitCount ; } return true ; }
Returns whether the values of this division grouping contain the prefix block for the given prefix length