KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > eclipse > jdt > ui > search > QuerySpecification


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.ui.search;
12
13 import org.eclipse.jdt.core.search.IJavaSearchScope;
14
15 /**
16  * <p>
17  * Describes a Java search query. A query is described by giving a scope, a
18  * scope description, what kind of match to search for (reference, declarations,
19  * etc) and either a Java element or a string and what kind of element to search
20  * for (type, field, etc). What exactly it means to, for example, to search for
21  * "references to type foo" is up to query participants. For example, a
22  * participant might consider the "class" attribute of an extension in a
23  * plugin.xml file to be a reference to the class mentioned in the attribute.
24  * </p>
25  *
26  * <p>
27  * This class is not intended to be instantiated or subclassed by clients.
28  * </p>
29  *
30  * @since 3.0
31  */

32 public abstract class QuerySpecification {
33     private IJavaSearchScope fScope;
34     private int fLimitTo;
35     private String JavaDoc fScopeDescription;
36
37     QuerySpecification(int limitTo, IJavaSearchScope scope, String JavaDoc scopeDescription) {
38         fScope= scope;
39         fLimitTo= limitTo;
40         fScopeDescription= scopeDescription;
41     }
42
43     /**
44      * Returns the search scope to be used in the query.
45      * @return The search scope.
46      */

47     public IJavaSearchScope getScope() {
48         return fScope;
49     }
50     
51     /**
52      * Returns a human readable description of the search scope.
53      * @return A description of the search scope.
54      * @see QuerySpecification#getScope()
55      */

56     public String JavaDoc getScopeDescription() {
57         return fScopeDescription;
58     }
59     
60     /**
61      * Returns what kind of occurrences the query should look for.
62      * @return Whether to search for reference, declaration, etc.
63      * @see org.eclipse.jdt.core.search.IJavaSearchConstants
64      */

65     public int getLimitTo() {
66         return fLimitTo;
67     }
68
69 }
70
Popular Tags