protected boolean isNetworkSection ( int networkPrefixLength , boolean withPrefixLength ) { int segmentCount = getSegmentCount ( ) ; if ( segmentCount == 0 ) { return true ; } int bitsPerSegment = getBitsPerSegment ( ) ; int prefixedSegmentIndex = getNetworkSegmentIndex ( networkPrefixLength , getBytesPerSegment ( ) , bitsPerSegment ) ; if ( prefixedSegmentIndex + 1 < segmentCount ) { return false ; //not the right number of segments } //the segment count matches, now compare the prefixed segment int segPrefLength = getPrefixedSegmentPrefixLength ( bitsPerSegment , networkPrefixLength , prefixedSegmentIndex ) ; return ! getSegment ( segmentCount - 1 ) . isNetworkChangedByPrefix ( segPrefLength , withPrefixLength ) ; }
this method is basically checking whether we can return this for getNetworkSection