class StructureDB extends CompositeDB implements Structure {

	@Override
	public DataTypeComponent getComponentAt(int offset) {
		lock.acquire();
		try {
			checkIsValid();
			if (offset >= structLength || offset < 0) {
				return null;
			}
			int index =
				Collections.binarySearch(components, Integer.valueOf(offset), offsetComparator);
			if (index >= 0) {
				DataTypeComponent dtc = components.get(index);
				if (dtc.isBitFieldComponent()) {
					index = backupToFirstComponentContainingOffset(index, offset);
					dtc = components.get(index);
				}
				return dtc;
			}
			else if (isInternallyAligned()) {
				return null;
			}
			index = -index - 1;
			int ordinal = offset;
			if (index > 0) {
				DataTypeComponent dtc = components.get(index - 1);
				ordinal = dtc.getOrdinal() + offset - dtc.getEndOffset();
			}
			return new DataTypeComponentDB(dataMgr, componentAdapter, this, key, ordinal, offset);
		}
		finally {
			lock.release();
		}
	}

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

}