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

		FieldIndex<T> index = thick ? caseInsensitive ? (FieldIndex<T>) new ThickCaseInsensitiveFieldIndex(
				this, type, fieldName) : (FieldIndex<T>) new ThickFieldIndex(
				this, type, fieldName)
				: caseInsensitive ? alternativeBtree ? (FieldIndex<T>) new AltBtreeCaseInsensitiveFieldIndex<T>(
						type, fieldName, unique)
						: (FieldIndex<T>) new BtreeCaseInsensitiveFieldIndex<T>(
								type, fieldName, unique)
						: alternativeBtree ? (FieldIndex<T>) new AltBtreeFieldIndex<T>(
								type, fieldName, unique)
								: (FieldIndex<T>) new BtreeFieldIndex<T>(type,
										fieldName, unique);
		index.assignOid(this, 0, false);
		return index;
	}