Start line:  
End line:  

Snippet Preview

Snippet HTML Code

Stack Overflow Questions
Copyright (c) 2000, 2008 IBM Corporation and others. All rights reserved. This program and the accompanying materials are made available under the terms of the Eclipse Public License v1.0 which accompanies this distribution, and is available at http://www.eclipse.org/legal/epl-v10.html Contributors: IBM Corporation - initial API and implementation /
 
 package org.eclipse.jdt.internal.core.search.matching;
 
 
 import  org.eclipse.core.runtime.IProgressMonitor;
 
 public class OrPattern extends SearchPattern implements IIndexConstants {
 
 	protected SearchPattern[] patterns;

One of R_ERASURE_MATCH, R_EQUIVALENT_MATCH, R_FULL_MATCH.
 
 
 	public OrPattern(SearchPattern leftPatternSearchPattern rightPattern) {
 		super(Math.max(leftPattern.getMatchRule(), rightPattern.getMatchRule()));
 		this. = ;
 		this. = leftPattern.mustResolve || rightPattern.mustResolve;
 
 		SearchPattern[] leftPatterns = leftPattern instanceof OrPattern ? ((OrPatternleftPattern). : null;
 		SearchPattern[] rightPatterns = rightPattern instanceof OrPattern ? ((OrPatternrightPattern). : null;
 		int leftSize = leftPatterns == null ? 1 : leftPatterns.length;
 		int rightSize = rightPatterns == null ? 1 : rightPatterns.length;
 		this. = new SearchPattern[leftSize + rightSize];
 
 		if (leftPatterns == null)
 			this.[0] = leftPattern;
 		else
 			System.arraycopy(leftPatterns, 0, this., 0, leftSize);
 		if (rightPatterns == null)
 			this.[leftSize] = rightPattern;
 		else
 			System.arraycopy(rightPatterns, 0, this.leftSizerightSize);
 
 		// Store erasure match
 		this. = 0;
 		for (int i = 0, length = this..lengthi < lengthi++) {
 		}
 	}
 	public void findIndexMatches(Index indexIndexQueryRequestor requestorSearchParticipant participantIJavaSearchScope scope, IProgressMonitor progressMonitorthrows IOException {
 		// per construction, OR pattern can only be used with a PathCollector (which already gather results using a set)
 		try {
 			index.startQuery();
 			for (int i = 0, length = this..lengthi < lengthi++)
 				this.[i].findIndexMatches(indexrequestorparticipantscopeprogressMonitor);
 		} finally {
 			index.stopQuery();
 		}
 	}
 
 		return null;
 	}
 
 	boolean isErasureMatch() {
 		return (this. & ) != 0;
 	}
 
 	public boolean isPolymorphicSearch() {
 		for (int i = 0, length = this..lengthi < lengthi++)
 			if (this.[i].isPolymorphicSearch()) return true;
 		return false;
 	}

Returns whether the pattern has one or several package declaration or not.

Returns:
true if one at least of the stored pattern is a package declaration pattern (PackageDeclarationPattern), false otherwise.
 
 	public final boolean hasPackageDeclaration() {
 		for (int i = 0, length = this..lengthi < lengthi++) {
 			if (this.[iinstanceof PackageDeclarationPatternreturn true;
 		}
 		return false;
 	}

Returns whether the pattern has signatures or not.

Returns:
true if one at least of the stored pattern has signatures.
 
 	public final boolean hasSignatures() {
 		boolean isErasureMatch = isErasureMatch();
		for (int i = 0, length = this..lengthi < length && !isErasureMatchi++) {
			if (((JavaSearchPatternthis.[i]).hasSignatures()) return true;
		}
		return false;
	}
	public String toString() {
		StringBuffer buffer = new StringBuffer();
		buffer.append(this.[0].toString());
		for (int i = 1, length = this..lengthi < lengthi++) {
			buffer.append("\n| "); //$NON-NLS-1$
			buffer.append(this.[i].toString());
		}
		return buffer.toString();
	}
New to GrepCode? Check out our FAQ X