KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > eclipse > jdt > internal > core > search > matching > SecondaryTypeDeclarationPattern


1 /*******************************************************************************
2  * Copyright (c) 2000, 2005 IBM Corporation and others.
3  * All rights reserved. This program and the accompanying materials
4  * are made available under the terms of the Eclipse Public License v1.0
5  * which accompanies this distribution, and is available at
6  * http://www.eclipse.org/legal/epl-v10.html
7  *
8  * Contributors:
9  * IBM Corporation - initial API and implementation
10  *******************************************************************************/

11 package org.eclipse.jdt.internal.core.search.matching;
12
13 import java.io.IOException JavaDoc;
14
15 import org.eclipse.jdt.core.search.SearchPattern;
16 import org.eclipse.jdt.internal.core.index.EntryResult;
17 import org.eclipse.jdt.internal.core.index.Index;
18 import org.eclipse.jdt.internal.core.search.indexing.IIndexConstants;
19
20 public class SecondaryTypeDeclarationPattern extends 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, R_EXACT_MATCH | R_CASE_SENSITIVE);
26 }
27
28 public SecondaryTypeDeclarationPattern(int matchRule) {
29     super(matchRule);
30 }
31
32 public SearchPattern getBlankPattern() {
33     return new SecondaryTypeDeclarationPattern(R_EXACT_MATCH | R_CASE_SENSITIVE);
34 }
35 protected StringBuffer JavaDoc print(StringBuffer JavaDoc output) {
36     output.append("Secondary"); //$NON-NLS-1$
37
return super.print(output);
38 }
39
40 /* (non-Javadoc)
41  * @see org.eclipse.jdt.internal.core.search.matching.TypeDeclarationPattern#queryIn(org.eclipse.jdt.internal.core.index.Index)
42  */

43 EntryResult[] queryIn(Index index) throws IOException JavaDoc {
44     return index.query(CATEGORIES, SECONDARY_PATTERN_KEY, R_PATTERN_MATCH | R_CASE_SENSITIVE);
45 }
46     
47 }
48
Popular Tags