All Downloads are FREE. Search and download functionalities are using the official Maven repository.

org.aspectj.org.eclipse.jdt.core.search.IParallelizable Maven / Gradle / Ivy

Go to download

AspectJ tools most notably contains the AspectJ compiler (AJC). AJC applies aspects to Java classes during compilation, fully replacing Javac for plain Java classes and also compiling native AspectJ or annotation-based @AspectJ syntax. Furthermore, AJC can weave aspects into existing class files in a post-compile binary weaving step. This library is a superset of AspectJ weaver and hence also of AspectJ runtime.

There is a newer version: 1.9.22.1
Show newest version
/*******************************************************************************
 * Copyright (c) 2020 Gayan Perera and others.
 *
 * This program and the accompanying materials
 * are made available under the terms of the Eclipse Public License 2.0
 * which accompanies this distribution, and is available at
 * https://www.eclipse.org/legal/epl-2.0/
 *
 * SPDX-License-Identifier: EPL-2.0
 *
 * Contributors:
 *     Gayan Perera - initial API and implementation
 *******************************************************************************/
package org.aspectj.org.eclipse.jdt.core.search;

import org.eclipse.core.runtime.IProgressMonitor;
import org.aspectj.org.eclipse.jdt.core.JavaModelException;
import org.aspectj.org.eclipse.jdt.internal.core.search.JavaSearchParticipant;

/**
 * This interface can be used by {@link IJavaSearchScope}, {@link JavaSearchParticipant} and {@link SearchPattern} to
 * mark implementors as eligible for parallel index search.
 *
 * @since 3.25
 */
public interface IParallelizable {
	/**
	 * Answers {@code true} if the current instance supports parallel index search
	 *
	 * @return Returns true if the implementation is safe to be used in a parallel search.
	 */
	boolean isParallelSearchSupported();

	/**
	 * Initialize all needed data before search is started
	 *
	 * @param monitor
	 *            non null progress callback
	 */
	default void initBeforeSearch(IProgressMonitor monitor) throws JavaModelException {
		// no op
	}

	/**
	 * Checks if the given object implements this interface and also returns true for
	 * {@link #isParallelSearchSupported()}.
	 *
	 * @param o
	 *            The object that needs to be checked. null value will result in returning
	 *            false.
	 * @return true if the given object can be used in parallel search.
	 */
	public static boolean isParallelSearchSupported(Object o) {
		return (o instanceof IParallelizable) && ((IParallelizable) o).isParallelSearchSupported();
	}

}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy