private int
parseNumeric(String s) {
	try {
		int val = Integer.parseInt(s);
		if (val >= 0 && val <= max)
			return val;
	}
	catch (NumberFormatException e) {
	}
	return -1;
}
Checks that a numeric value is within the range [0..max]
src/main/java/core/org/xbill/DNS/Mnemonic.java