|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectnet.jot.search.simpleindexer.JOTIndexHandler
public class JOTIndexHandler
Helper to JOTSimpleSearchEngine to handle the index files. The master file: index.txt and the index files ex: 0A/EF.txt
| Constructor Summary | |
|---|---|
JOTIndexHandler(java.io.File rootFolder)
|
|
| Method Summary | |
|---|---|
void |
addMasterEntry(int id,
java.lang.String key,
long lastModified)
Adds a new entry to index.txt |
java.lang.String |
findKeywordIndexLine(java.lang.String keyword)
Return the index file line for a specific keyword or empty string if none found. |
long |
getEntryStamp(java.lang.String key)
Get the timestamp of last indexing of an entry |
java.lang.String |
getMasterIdByKey(java.lang.String key)
|
java.lang.String |
getMasterKeyById(java.lang.String id)
|
boolean |
indexKeyword(java.lang.String id,
java.lang.String word,
java.util.Vector lines)
Add a keyword to the index id: id of the key in index.txt word: the keyword to be indexed lines: vector of line numbers return: wether it was a new keyword or not |
boolean |
isNewKey(java.lang.String key)
wether the key is new or already indexed |
protected void |
loadMasterFile()
Called from constructor loads existing index.txt |
void |
removeEntries(java.lang.String key)
Remove an entry keywords from indexes Does not remove the entry itself(ie: file) from the index master itself, call removeMasterEntry for that. |
void |
removeMasterEntry(java.lang.String key)
Remove the file/key from the master index (ie: deleted file) |
void |
saveMasterFile()
saves index.txt |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public JOTIndexHandler(java.io.File rootFolder)
throws java.lang.Exception
java.lang.Exception| Method Detail |
|---|
protected void loadMasterFile()
throws java.lang.Exception
java.lang.Exception
public void saveMasterFile()
throws java.lang.Exception
java.lang.Exceptionpublic long getEntryStamp(java.lang.String key)
key -
public boolean isNewKey(java.lang.String key)
key -
public void addMasterEntry(int id,
java.lang.String key,
long lastModified)
throws java.lang.Exception
id - key - lastModified -
java.lang.Exceptionpublic java.lang.String getMasterKeyById(java.lang.String id)
public java.lang.String getMasterIdByKey(java.lang.String key)
public void removeEntries(java.lang.String key)
throws java.lang.Exception
id -
java.lang.Exception
public void removeMasterEntry(java.lang.String key)
throws java.lang.Exception
id -
java.lang.Exception
public boolean indexKeyword(java.lang.String id,
java.lang.String word,
java.util.Vector lines)
throws java.lang.Exception
java.lang.Exception
public java.lang.String findKeywordIndexLine(java.lang.String keyword)
throws java.lang.Exception
java.lang.Exception
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||