private void buildMapping() {
		int numRanges = currentViewAddressSet.getNumAddressRanges();
		indexList = new BigInteger[numRanges + 1];
		addressList = new Address[numRanges];

		BigInteger index = BigInteger.ZERO;
		int i = 0;
		for (AddressRange range : currentViewAddressSet) {
			indexList[i] = index;
			addressList[i] = range.getMinAddress();
			index = index.add(range.getBigLength());
			i++;
		}
		indexList[numRanges] = index;
		numAddresses = index;
		minIndex = BigInteger.valueOf(-1);
		maxIndex = minIndex;

		// make the minimum viewable gap size to be 1% of the total view size (but not smaller than default)
		minimumUnviewableGapSize = numAddresses.divide(PERCENT_DIVIDER);
		if (minimumUnviewableGapSize.compareTo(DEFAULT_UNVIEWABLE_GAP_SIZE) < 0) {
			minimumUnviewableGapSize = DEFAULT_UNVIEWABLE_GAP_SIZE;
		}
	}
gets the address for the given index given the rangeIndex of the range that contains that index
@param rangeIndex the index of the range of indexes that contains the index of interest.
@param index the index to get an address for
@return the address corresponding to the given index.
Ghidra/Features/Base/src/main/java/ghidra/app/util/viewer/util/AddressIndexMap.java