@Override
	protected int getNumBytesInRange(FieldRange range) {
		int numBytesInRange = 0;
		if (range != null) {
			// Determine the number of bytes.
			// Get the size of the range.
			for (int i = range.getStart().getIndex().intValue(); i < range.getEnd()
					.getIndex()
					.intValue(); i++) {
				DataTypeComponent comp = getComponent(i);
				numBytesInRange = Math.max(numBytesInRange, comp.getLength());
			}
		}
		return numBytesInRange;
	}
Returns the number of bytes that are included in the current selection
range.

@param range the range of indices for the component's whose sizes should
be added together.
Ghidra/Features/Base/src/main/java/ghidra/app/plugin/core/compositeeditor/UnionEditorModel.java