class StructureDB extends CompositeDB implements Structure {

	@Override
	public DataTypeComponent replace(int ordinal, DataType dataType, int length, String name,
			String comment) throws IllegalArgumentException {
		lock.acquire();
		try {
			checkDeleted();

			if (ordinal < 0 || ordinal >= numComponents) {
				throw new ArrayIndexOutOfBoundsException(ordinal);
			}

			validateDataType(dataType);

			DataTypeComponent origDtc = getComponent(ordinal);
			if (origDtc.isBitFieldComponent()) {
				throw new IllegalArgumentException(
					"Bit-field component may not be directly replaced");
			}

			if (dataType == DataType.DEFAULT) {
				clearComponent(ordinal);
				return getComponent(ordinal);
			}

			dataType = resolve(dataType);
			checkAncestry(dataType);

			length = getPreferredComponentLength(dataType, length);

			DataTypeComponent replaceComponent =
				replaceComponent(origDtc, dataType, length, name, comment, true);
			adjustInternalAlignment(true);
			return replaceComponent;
		}
		catch (DataTypeDependencyException e) {
			throw new IllegalArgumentException(e.getMessage(), e);
		}
		finally {
			lock.release();
		}
	}

	public  StructureDB(DataTypeManagerDB dataMgr, DBObjectCache<DataTypeDB> cache,
			CompositeDBAdapter compositeAdapter, ComponentDBAdapter componentAdapter,
			Record record);

}