private long getMaxPossibleValue(int bytes, boolean allowNegativeValues) {
		if (bytes == 8) {
			return Long.MAX_VALUE;
		}
		int bits = bytes * 8;
		if (allowNegativeValues) {
			bits -= 1;  // take away 1 bit for the sign
		}

		// the largest value that can be held in n bits in 2^n -1
		return (1L << bits) - 1;
	}
Database implementation for the enumerated data type.
Ghidra/Framework/SoftwareModeling/src/main/java/ghidra/program/database/data/EnumDB.java