|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object net.sf.dictccfe.and.Thr net.sf.dictccfe.and.Search
public abstract class Search
Base class for exact and similar searching.
Nested Class Summary | |
---|---|
class |
Search.DictConfig
Dictionary configuration. |
Field Summary | |
---|---|
private Search.DictConfig |
m_cfg
Dictionary configuration. |
private android.database.sqlite.SQLiteDatabase |
m_db
The dictionary index database. |
private java.lang.CharSequence |
m_keyword
The keyword to search. |
private ISearchResult |
m_searchresult
The callback for results. |
Constructor Summary | |
---|---|
Search()
Initializes an empty object. |
Method Summary | |
---|---|
protected abstract void |
dosearch(android.database.sqlite.SQLiteDatabase aDb,
java.lang.CharSequence aKey,
ISearchResult aSearchResult)
The real implementation of the searching algorithm. |
protected Search.DictConfig |
getDictConfig()
Returns the configuration of the dictionary index database. |
private static java.io.File |
getDictFile(java.lang.String aDictFileName)
Returns the full path of the dictionary file. |
void |
run()
Searches for keywords or descriptions. |
void |
search(java.lang.CharSequence aKey,
ISearchResult aSearchResult)
Searches for the keyword. |
void |
setDb(android.database.sqlite.SQLiteDatabase aDb)
Sets the dictionary index database. |
Methods inherited from class net.sf.dictccfe.and.Thr |
---|
getGoon, start, stop |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
private android.database.sqlite.SQLiteDatabase m_db
private Search.DictConfig m_cfg
private java.lang.CharSequence m_keyword
private ISearchResult m_searchresult
Constructor Detail |
---|
public Search()
Method Detail |
---|
private static java.io.File getDictFile(java.lang.String aDictFileName)
aDictFileName
- the dictionary file name.
public final void setDb(android.database.sqlite.SQLiteDatabase aDb)
aDb
- the dictionary index database to set.protected final Search.DictConfig getDictConfig()
public final void search(java.lang.CharSequence aKey, ISearchResult aSearchResult)
aKey
- the keyword to search.aSearchResult
- interface for search result callbacks.public final void run()
run
in interface java.lang.Runnable
run
in class Thr
protected abstract void dosearch(android.database.sqlite.SQLiteDatabase aDb, java.lang.CharSequence aKey, ISearchResult aSearchResult) throws java.lang.Exception
aDb
- the database in which to search for keywords and/or
description. It is never null.aKey
- the keyword to search. It is never null.aSearchResult
- the interface for search result callbacks. This
parameter may be null.
java.lang.Exception
- the exceptions throw by this method are shown using
ISearchResult.showException().
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |