public synchronized <T> FieldIndex<T> createFieldIndex(Class type,
			String[] fieldNames, boolean unique, boolean caseInsensitive) {
		if (!opened) {
			throw new StorageError(StorageError.STORAGE_NOT_OPENED);
		}

		FieldIndex<T> index = caseInsensitive ? alternativeBtree ? (FieldIndex<T>) new AltBtreeCaseInsensitiveMultiFieldIndex(
				type, fieldNames, unique)
				: (FieldIndex<T>) new BtreeCaseInsensitiveMultiFieldIndex(type,
						fieldNames, unique)
				: alternativeBtree ? (FieldIndex<T>) new AltBtreeMultiFieldIndex(
						type, fieldNames, unique)
						: (FieldIndex<T>) new BtreeMultiFieldIndex(type,
								fieldNames, unique);
		index.assignOid(this, 0, false);
		return index;
	}