Build 1.0_r1(from source)

android.widget
Class CursorFilter

java.lang.Object
  extended by android.widget.Filter
      extended by android.widget.CursorFilter

 class CursorFilter
extends Filter

The CursorFilter delegates most of the work to the CursorAdapter. Subclasses should override these delegate methods to run the queries and convert the results into String that can be used by auto-completion widgets.


Nested Class Summary
(package private) static interface CursorFilter.CursorFilterClient
           
 
Nested classes/interfaces inherited from class android.widget.Filter
Filter.FilterListener, Filter.FilterResults
 
Field Summary
(package private)  CursorFilter.CursorFilterClient mClient
           
 
Constructor Summary
CursorFilter(CursorFilter.CursorFilterClient client)
           
 
Method Summary
 CharSequence convertResultToString(Object resultValue)
          Converts a value from the filtered set into a CharSequence.
protected  Filter.FilterResults performFiltering(CharSequence constraint)
          Invoked in a worker thread to filter the data according to the constraint.
protected  void publishResults(CharSequence constraint, Filter.FilterResults results)
          Invoked in the UI thread to publish the filtering results in the user interface.
 
Methods inherited from class android.widget.Filter
filter, filter
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

mClient

CursorFilter.CursorFilterClient mClient
Constructor Detail

CursorFilter

CursorFilter(CursorFilter.CursorFilterClient client)
Method Detail

convertResultToString

public CharSequence convertResultToString(Object resultValue)
Description copied from class: Filter

Converts a value from the filtered set into a CharSequence. Subclasses should override this method to convert their results. The default implementation returns an empty String for null values or the default String representation of the value.

Overrides:
convertResultToString in class Filter
Parameters:
resultValue - the value to convert to a CharSequence
Returns:
a CharSequence representing the value

performFiltering

protected Filter.FilterResults performFiltering(CharSequence constraint)
Description copied from class: Filter

Invoked in a worker thread to filter the data according to the constraint. Subclasses must implement this method to perform the filtering operation. Results computed by the filtering operation must be returned as a Filter.FilterResults that will then be published in the UI thread through Filter.publishResults(CharSequence, android.widget.Filter.FilterResults).

Contract: When the constraint is null, the original data must be restored.

Specified by:
performFiltering in class Filter
Parameters:
constraint - the constraint used to filter the data
Returns:
the results of the filtering operation
See Also:
Filter.filter(CharSequence, android.widget.Filter.FilterListener), Filter.publishResults(CharSequence, android.widget.Filter.FilterResults), Filter.FilterResults

publishResults

protected void publishResults(CharSequence constraint,
                              Filter.FilterResults results)
Description copied from class: Filter

Invoked in the UI thread to publish the filtering results in the user interface. Subclasses must implement this method to display the results computed in Filter.performFiltering(java.lang.CharSequence).

Specified by:
publishResults in class Filter
Parameters:
constraint - the constraint used to filter the data
results - the results of the filtering operation
See Also:
Filter.filter(CharSequence, android.widget.Filter.FilterListener), Filter.performFiltering(CharSequence), Filter.FilterResults

Build 1.0_r1(from source)

Please submit a feedback, bug or feature