private void recache ( ) { // If we've already cached the values then don't bother recalculating; we // assume a mask of 0 means a recompute is needed (unless prefix is also 0) // We skip the computation completely is prefix is 0 - this is fine, since // the mask and maskedNetwork for prefix 0 result in 0, the default values. // We need to special-case /0 because our mask generation code doesn't work for // prefix=0 (since -1 << 32 != 0) if ( mask == 0 && prefix != 0 ) { this . mask = - 1 << ( 32 - prefix ) ; this . maskedNetwork = IpHelper . aton ( network ) & mask ; } }
Repopulates the transient fields based on the IP and prefix