|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
public interface IIndex
An IIndex is the interface used to generate an index file, and to make queries on this index.
Method Summary | |
---|---|
void |
add(IDocument document,
IIndexer indexer)
Adds the given document to the index. |
void |
close()
Closes the index file if open |
void |
dispose()
closes the index file then deletes it. |
void |
empty()
Empties the index. |
java.io.File |
getIndexFile()
Returns the index file on the disk. |
int |
getNumDocuments()
Returns the number of documents indexed. |
int |
getNumWords()
Returns the number of unique words indexed. |
java.lang.String |
getPath(int documentNumber)
Returns the path corresponding to a given document number |
boolean |
hasChanged()
Ansers true if has some changes to save. |
IQueryResult[] |
query(java.lang.String word)
Returns the paths of the documents containing the given word. |
IEntryResult[] |
queryEntries(char[] pattern)
Returns all entries for a given word. |
IQueryResult[] |
queryInDocumentNames(java.lang.String word)
Returns the paths of the documents whose names contain the given word. |
IQueryResult[] |
queryPrefix(char[] prefix)
Returns the paths of the documents containing the given word prefix. |
void |
remove(java.lang.String documentName)
Removes the corresponding document from the index. |
void |
save()
Saves the index on the disk. |
void |
setDoCache(boolean doCache)
sets a boolean indicating the index file will be cached and should remain open and in-memory |
Method Detail |
---|
void add(IDocument document, IIndexer indexer) throws java.io.IOException
java.io.IOException
void empty() throws java.io.IOException
java.io.IOException
java.io.File getIndexFile()
int getNumDocuments() throws java.io.IOException
java.io.IOException
int getNumWords() throws java.io.IOException
java.io.IOException
java.lang.String getPath(int documentNumber) throws java.io.IOException
java.io.IOException
boolean hasChanged()
IQueryResult[] query(java.lang.String word) throws java.io.IOException
java.io.IOException
IEntryResult[] queryEntries(char[] pattern) throws java.io.IOException
java.io.IOException
IQueryResult[] queryInDocumentNames(java.lang.String word) throws java.io.IOException
java.io.IOException
IQueryResult[] queryPrefix(char[] prefix) throws java.io.IOException
java.io.IOException
void remove(java.lang.String documentName) throws java.io.IOException
java.io.IOException
void save() throws java.io.IOException
java.io.IOException
void close()
void dispose()
void setDoCache(boolean doCache)
doCache
-
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |