@Override
	public void delete(Set<Integer> ordinals) {

		if (ordinals.isEmpty()) {
			return;
		}

		if (ordinals.size() == 1) {
			ordinals.forEach(ordinal -> delete(ordinal));
			return;
		}

		lock.acquire();
		try {
			checkDeleted();

			if (isPackingEnabled()) {
				getComputedAlignment(true); // ensure previous alignment has been stored
			}

			List<DataTypeComponentDB> newComponents = new ArrayList<>();
			int newLength = 0;
			int ordinalAdjustment = 0;
			for (DataTypeComponentDB dtc : components) {
				int ordinal = dtc.getOrdinal();
				if (ordinals.contains(ordinal)) {
					// component removed - delete record
					dtc.getDataType().removeParent(this);
					removeComponentRecord(dtc.getKey());
					--ordinalAdjustment;
				}
				else {
					if (ordinalAdjustment != 0) {
						dtc.setOrdinal(dtc.getOrdinal() + ordinalAdjustment, true);
					}
					newComponents.add(dtc);
					newLength = Math.max(newLength, dtc.getLength());
				}
			}
			components = newComponents;

			if (isPackingEnabled()) {
				if (!repack(false, true)) {
					dataMgr.dataTypeChanged(this, false);
				}
			}
			else {
				boolean sizeChanged = (unionLength != newLength);
				if (sizeChanged) {
					unionLength = newLength;
					record.setIntValue(CompositeDBAdapter.COMPOSITE_LENGTH_COL, unionLength);
				}
				compositeAdapter.updateRecord(record, true);

				if (sizeChanged) {
					notifySizeChanged(false);
				}
				else {
					dataMgr.dataTypeChanged(this, false);
				}
			}
		}
		catch (IOException e) {
			dataMgr.dbError(e);
		}
		finally {
			lock.release();
		}
	}
Constructor

@param dataMgr
@param cache
@param compositeAdapter
@param componentAdapter
@param record
Ghidra/Framework/SoftwareModeling/src/main/java/ghidra/program/database/data/UnionDB.java