public synchronized <T> Index<T> createIndex(Class[] keyTypes,
			boolean unique) {
		if (!opened) {
			throw new StorageError(StorageError.STORAGE_NOT_OPENED);
		}

		Index<T> index = alternativeBtree ? (Index<T>) new AltBtreeCompoundIndex<T>(
				keyTypes, unique) : (Index<T>) new BtreeCompoundIndex<T>(
				keyTypes, unique);
		index.assignOid(this, 0, false);
		return index;
	}