|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectsk.baka.ambient.activity.search.CollectionEngine
public final class CollectionEngine
Search the collection for given query.
| Constructor Summary | |
|---|---|
CollectionEngine(ICollection collection)
Creates new collection engine which performs search on an arbitrary ICollection. |
|
| Method Summary | |
|---|---|
boolean |
canPerformSearch()
Checks if this engine can currently perform the search. |
boolean |
canSearchOffline()
Checks if this engine can perform an offline search. |
SearchType |
getType()
Returns the type of this engine. |
void |
init(SearchActivity owner,
int listViewId)
Sets the owner activity and initializes the engine. |
void |
passivate()
Passivates this engine. |
List<? extends Object> |
performSearch(String query)
Performs a search for tracks contained words in given query. |
void |
update(List<? extends Object> model)
Updates the list view with given model. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
CollectionEngine(ICollection collection)
ICollection.
collection - the collection strategy.| Method Detail |
|---|
public boolean canSearchOffline()
ISearchEngine
canSearchOffline in interface ISearchEnginetrue if search can be performed offline,
false otherwise.
public void init(SearchActivity owner,
int listViewId)
ISearchEngine
init in interface ISearchEngineowner - owner view.listViewId - the ID of the list view. Note that the list view is always
configured to layout items using the
playlist_item.xml layout.public void passivate()
ISearchEngineGesturesListView etc. Executed in handler thread.
passivate in interface ISearchEngine
public List<? extends Object> performSearch(String query)
throws Exception
ISearchEnginenull list which will serve as a model for
GesturesListView. The method always executes in a new thread. The
method should periodically check for Thread.isInterrupted() and
terminate ASAP when interrupted.
performSearch in interface ISearchEnginequery - the query to search for
null if interrupted. Given list must contain
thread-safe objects.
Exception - if search failed.public void update(List<? extends Object> model)
ISearchEngineGesturesListView.listener and must be able to correctly display
items returned by the ISearchEngine.performSearch(String) method.
update in interface ISearchEnginemodel - the model as returned by ISearchEngine.performSearch(String).public SearchType getType()
ISearchEngine
getType in interface ISearchEnginepublic boolean canPerformSearch()
ISearchEngine
canPerformSearch in interface ISearchEnginetrue if search can be performed, false
otherwise.
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||