org.aspectj.org.eclipse.jdt.internal.core.index
Class Index
java.lang.Object
org.aspectj.org.eclipse.jdt.internal.core.index.Index
public class Index
- extends java.lang.Object
An Index maps document names to their referenced words in various categories.
Queries can search a single category or several at the same time.
Indexes are not synchronized structures and should only be queried/updated one at a time.
|
Constructor Summary |
Index(java.lang.String fileName,
java.lang.String containerPath,
boolean reuseExistingFile)
|
|
Method Summary |
void |
addIndexEntry(char[] category,
char[] key,
java.lang.String containerRelativePath)
|
java.lang.String |
containerRelativePath(java.lang.String documentPath)
|
java.io.File |
getIndexFile()
|
boolean |
hasChanged()
|
boolean |
isIndexForJar()
|
static boolean |
isMatch(char[] pattern,
char[] word,
int matchRule)
|
EntryResult[] |
query(char[][] categories,
char[] key,
int matchRule)
Returns the entries containing the given key in a group of categories, or null if no matches are found. |
java.lang.String[] |
queryDocumentNames(java.lang.String substring)
Returns the document names that contain the given substring, if null then returns all of them. |
void |
remove(java.lang.String containerRelativePath)
|
void |
reset()
Reset memory and disk indexes. |
void |
save()
|
void |
startQuery()
|
void |
stopQuery()
|
java.lang.String |
toString()
|
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
containerPath
public java.lang.String containerPath
monitor
public ReadWriteMonitor monitor
separator
public char separator
diskIndex
protected DiskIndex diskIndex
memoryIndex
protected MemoryIndex memoryIndex
Index
public Index(java.lang.String fileName,
java.lang.String containerPath,
boolean reuseExistingFile)
throws java.io.IOException
- Throws:
java.io.IOException
isMatch
public static boolean isMatch(char[] pattern,
char[] word,
int matchRule)
addIndexEntry
public void addIndexEntry(char[] category,
char[] key,
java.lang.String containerRelativePath)
containerRelativePath
public java.lang.String containerRelativePath(java.lang.String documentPath)
getIndexFile
public java.io.File getIndexFile()
hasChanged
public boolean hasChanged()
query
public EntryResult[] query(char[][] categories,
char[] key,
int matchRule)
throws java.io.IOException
- Returns the entries containing the given key in a group of categories, or null if no matches are found.
The matchRule dictates whether its an exact, prefix or pattern match, as well as case sensitive or insensitive.
If the key is null then all entries in specified categories are returned.
- Throws:
java.io.IOException
queryDocumentNames
public java.lang.String[] queryDocumentNames(java.lang.String substring)
throws java.io.IOException
- Returns the document names that contain the given substring, if null then returns all of them.
- Throws:
java.io.IOException
remove
public void remove(java.lang.String containerRelativePath)
reset
public void reset()
throws java.io.IOException
- Reset memory and disk indexes.
- Throws:
java.io.IOException
save
public void save()
throws java.io.IOException
- Throws:
java.io.IOException
startQuery
public void startQuery()
stopQuery
public void stopQuery()
toString
public java.lang.String toString()
- Overrides:
toString in class java.lang.Object
isIndexForJar
public boolean isIndexForJar()