public BigInteger getIndex(Address addr) {
		int arrIndex = Arrays.binarySearch(addressList, addr);
		if (arrIndex >= 0) {
			return indexList[arrIndex];
		}
		arrIndex = -arrIndex - 2;
		if (arrIndex < 0) {
			return null;
		}
		if (!(addr.getAddressSpace().equals(addressList[arrIndex].getAddressSpace()))) {
			return null;
		}
		BigInteger offset =
			addr.getOffsetAsBigInteger().subtract(addressList[arrIndex].getOffsetAsBigInteger());
		BigInteger index = indexList[arrIndex].add(offset);

		if (index.compareTo(indexList[arrIndex + 1]) >= 0) {
			return null;
		}
		return index;
	}
Returns the index for the given address.  If the address is not mapped, null will be returned

@param addr the address for which to retrieve the index.
@return the index associated with the given address.
Ghidra/Features/Base/src/main/java/ghidra/app/util/viewer/util/AddressIndexMap.java