Java Utililty Methods IP Address Mash

List of utility methods to do IP Address Mash

Description

The list of methods to do IP Address Mash are organized into topic(s).

Method

StringcheckIpMask(String ip)
check Ip Mask
String ipParts[] = ip.split("\\.");
if (ipParts.length != 4)
    return "IP address must have 4 parts";
String message = checkIpMaskPart(ipParts[0]);
if (message != null)
    return message;
message = checkIpMaskPart(ipParts[1]);
if (message != null)
...
StringcheckIpMaskPart(String part)
check Ip Mask Part
if ("*".equals(part))
    return null;
int dash = part.indexOf('-');
try {
    if (dash == -1) {
        int value = Integer.parseInt(part);
        if (value < 0 || value > 255)
            return "Value out of range in '" + part + "'";
...
StringcheckIpMaskPart(String part)
check Ip Mask Part
int dash;
if ("*".equals(part))
    return null;
dash = part.indexOf('-');
if (dash == -1) {
    int value = Integer.parseInt(part);
    if (value < 0 || value > 255)
        return (new StringBuilder()).append("Value out of range in '").append(part).append("'").toString();
...