public FieldSelection getFieldSelection(AddressSetView set) {
		AddressSetView addrSet = currentViewAddressSet.intersect(set);
		FieldSelection fs = new FieldSelection();
		for (AddressRange range : addrSet) {
			BigInteger minRangeIndex = getIndex(range.getMinAddress());
			BigInteger maxRangeIndex = getIndex(range.getMaxAddress());
			// If you can't get an index for min or max then discard the range (don't add to selection).
			if (maxRangeIndex != null && minRangeIndex != null) {
				fs.addRange(minRangeIndex, maxRangeIndex.add(BigInteger.ONE));
			}
		}
		return fs;
	}
Returns a FieldSelection containing the set of indexes represented by the
given address set

@param set
           the set of addresses to convert into a set of indexes.
@return a FieldSelection for the given address set.
Ghidra/Features/Base/src/main/java/ghidra/app/util/viewer/util/AddressIndexMap.java