KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > eclipse > jdt > internal > core > search > indexing > InternalSearchDocument


1 /*******************************************************************************
2  * Copyright (c) 2004, 2007 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.indexing;
12
13 import org.eclipse.jdt.internal.compiler.SourceElementParser;
14 import org.eclipse.jdt.internal.core.index.Index;
15
16 /**
17  * Internal search document implementation
18  */

19 public class InternalSearchDocument {
20     Index index;
21     private String JavaDoc containerRelativePath;
22     SourceElementParser parser;
23     /*
24      * Hidden by API SearchDocument subclass
25      */

26     public void addIndexEntry(char[] category, char[] key) {
27         if (this.index != null)
28             index.addIndexEntry(category, key, getContainerRelativePath());
29     }
30     private String JavaDoc getContainerRelativePath() {
31         if (this.containerRelativePath == null)
32             this.containerRelativePath = this.index.containerRelativePath(getPath());
33         return this.containerRelativePath;
34     }
35     /*
36      * Hidden by API SearchDocument subclass
37      */

38     public void removeAllIndexEntries() {
39         if (this.index != null)
40             index.remove(getContainerRelativePath());
41     }
42     /*
43      * Hidden by API SearchDocument subclass
44      */

45     public String JavaDoc getPath() {
46         return null; // implemented by subclass
47
}
48 }
49
Popular Tags