public Address getAddress(BigInteger index) {
		if (index == null || index.compareTo(BigInteger.ZERO) < 0 ||
			index.compareTo(numAddresses) >= 0) {
			return null;
		}
		int arrIndex = 0;

		int compareTo = index.compareTo(minIndex);
		if (compareTo == 0) {
			return addressList[lastUsedRangeIndex];
		}
		if (index.compareTo(minIndex) > 0 && index.compareTo(maxIndex) < 0) {
			arrIndex = lastUsedRangeIndex;
		}
		else {
			arrIndex = Arrays.binarySearch(indexList, index);
			if (arrIndex >= 0) {
				minIndex = indexList[arrIndex];
				maxIndex = indexList[arrIndex + 1];
				lastUsedRangeIndex = arrIndex;
				return addressList[arrIndex];
			}
			arrIndex = -arrIndex - 2;
			minIndex = indexList[arrIndex];
			maxIndex = indexList[arrIndex + 1];
			lastUsedRangeIndex = arrIndex;
		}
		BigInteger offset = index.subtract(indexList[arrIndex]);
		try {
			return addressList[arrIndex].addNoWrap(offset);
		}
		catch (AddressOverflowException e) {
			Msg.showError(this, null, "Bad Index Map", e.getMessage());
			return null;
		}
	}
Returns the i'th address in the set.

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