01: /*******************************************************************************
02: * Copyright (c) 2000, 2005 IBM Corporation and others.
03: * All rights reserved. This program and the accompanying materials
04: * are made available under the terms of the Eclipse Public License v1.0
05: * which accompanies this distribution, and is available at
06: * http://www.eclipse.org/legal/epl-v10.html
07: *
08: * Contributors:
09: * IBM Corporation - initial API and implementation
10: *******************************************************************************/package org.eclipse.jdt.internal.core.search.matching;
11:
12: import java.io.IOException;
13:
14: import org.eclipse.jdt.core.search.SearchPattern;
15: import org.eclipse.jdt.internal.core.index.EntryResult;
16: import org.eclipse.jdt.internal.core.index.Index;
17: import org.eclipse.jdt.internal.core.search.indexing.IIndexConstants;
18:
19: public class SecondaryTypeDeclarationPattern extends
20: TypeDeclarationPattern {
21:
22: private final static char[] SECONDARY_PATTERN_KEY = "*/S".toCharArray(); //$NON-NLS-1$
23:
24: public SecondaryTypeDeclarationPattern() {
25: super (null, null, null, IIndexConstants.SECONDARY_SUFFIX,
26: R_EXACT_MATCH | R_CASE_SENSITIVE);
27: }
28:
29: public SecondaryTypeDeclarationPattern(int matchRule) {
30: super (matchRule);
31: }
32:
33: public SearchPattern getBlankPattern() {
34: return new SecondaryTypeDeclarationPattern(R_EXACT_MATCH
35: | R_CASE_SENSITIVE);
36: }
37:
38: protected StringBuffer print(StringBuffer output) {
39: output.append("Secondary"); //$NON-NLS-1$
40: return super .print(output);
41: }
42:
43: /* (non-Javadoc)
44: * @see org.eclipse.jdt.internal.core.search.matching.TypeDeclarationPattern#queryIn(org.eclipse.jdt.internal.core.index.Index)
45: */
46: EntryResult[] queryIn(Index index) throws IOException {
47: return index.query(CATEGORIES, SECONDARY_PATTERN_KEY,
48: R_PATTERN_MATCH | R_CASE_SENSITIVE);
49: }
50:
51: }
|