public static long parseLong(String longStr) {
		boolean isNegative = longStr.startsWith("-");
		if (isNegative) {
			longStr = longStr.substring(1);
		}
		int radix = 10;
		if (longStr.startsWith("0x")) {
			longStr = longStr.substring(2);
			radix = 16;
		}
		long val = (radix == 10) ? NumericUtilities.parseLong(longStr)
				: NumericUtilities.parseHexLong(longStr);
		if (isNegative) {
			val *= -1;
		}
		return val;
	}
Parse the given string as either a hex number (if it starts with 0x) or a
decimal number.

@param longStr the string to parse into an long
@return the parsed long.
@throws NumberFormatException if the given string does not represent a
            valid long.
Ghidra/Framework/Generic/src/main/java/ghidra/util/xml/XmlUtilities.java