Modifier and Type | Method and Description |
---|---|
ListenerToken |
addChangeListener(Executor executor,
QueryChangeListener listener)
Adds a query change listener with the dispatch queue on which changes
will be posted.
|
ListenerToken |
addChangeListener(QueryChangeListener listener)
Adds a query change listener.
|
ResultSet |
execute()
Executes the query.
|
String |
explain()
Returns a string describing the implementation of the compiled query.
|
Parameters |
getParameters()
Returns a copies of the current parameters.
|
void |
removeChangeListener(ListenerToken token)
Removes a change listener wih the given listener token.
|
void |
setParameters(Parameters parameters)
Set parameters should copy the given parameters.
|
String |
toString() |
@Nullable public Parameters getParameters()
getParameters
in interface Query
public void setParameters(@Nullable Parameters parameters)
setParameters
in interface Query
@NonNull public ResultSet execute() throws CouchbaseLiteException
The results come from a snapshot of the database taken at the moment the run() method is called, so they will not reflect any changes made to the database afterwards.
execute
in interface Query
CouchbaseLiteException
- if there is an error when running the query.@NonNull public String explain() throws CouchbaseLiteException
explain
in interface Query
CouchbaseLiteException
- if an error occurs@NonNull public ListenerToken addChangeListener(@NonNull QueryChangeListener listener)
addChangeListener
in interface Query
listener
- The listener to post changes.@NonNull public ListenerToken addChangeListener(@Nullable Executor executor, @NonNull QueryChangeListener listener)
addChangeListener
in interface Query
executor
- The executor object that calls listener. If null, use default executor.listener
- The listener to post changes.public void removeChangeListener(@NonNull ListenerToken token)
removeChangeListener
in interface Query
token
- The listener token.