code: private void calculate(String mask) {
          Matcher matcher = cidrPattern.matcher(mask);
  
          if (matcher.matches()) {
              address = matchAddress(matcher);
  
              /* Create a binary netmask from the number of bits specification /x */
              int cidrPart = rangeCheck(Integer.parseInt(matcher.group(5)), 0, NBITS);
              for (int j = 0; j < cidrPart; ++j) {
                  netmask |= (1 << 31 - j);
              }
  
          } else {
              throw new IllegalArgumentException("Could not parse [" + mask + "]");
          }
      }
docs: /*
  Initialize the internal fields from the supplied CIDR mask