public class HistoryQueryImpl extends java.lang.Object implements HistoryQuery
Constructor and Description |
---|
HistoryQueryImpl(java.lang.String queryString)
Creates an instance of HistoryQueryImpl by specifying the query
string it was created for.
|
Modifier and Type | Method and Description |
---|---|
(package private) void |
addHistoryRecord(HistoryRecord record)
Adds the given HistoryRecord to the result list of this query
and notifies all interested listeners that a new record is received.
|
void |
addHistoryRecordsListener(HistoryQueryListener l)
Adds the given HistoryQueryListener to the list of
listeners interested in query result changes.
|
void |
cancel()
Cancels this query.
|
java.util.Collection<HistoryRecord> |
getHistoryRecords()
Returns a collection of the results for this query.
|
java.lang.String |
getQueryString()
Returns the query string, this query was created for.
|
(package private) boolean |
isCanceled()
Indicates if this query has been canceled.
|
void |
removeHistoryRecordsListener(HistoryQueryListener l)
Removes the given HistoryQueryListener from the list of
listeners interested in query result changes.
|
(package private) void |
setStatus(int queryStatus)
Sets this query status to the given queryStatus and notifies
all interested listeners of the change.
|
public HistoryQueryImpl(java.lang.String queryString)
queryString
- the query string we're looking for in this querypublic void cancel()
cancel
in interface HistoryQuery
boolean isCanceled()
public java.util.Collection<HistoryRecord> getHistoryRecords()
This method could be used in order to obtain first fast initial results and then obtain the additional results through the HistoryQueryListener, which should improve user experience when waiting for results.
getHistoryRecords
in interface HistoryQuery
public void addHistoryRecordsListener(HistoryQueryListener l)
addHistoryRecordsListener
in interface HistoryQuery
l
- the HistoryQueryListener to addpublic void removeHistoryRecordsListener(HistoryQueryListener l)
removeHistoryRecordsListener
in interface HistoryQuery
l
- the HistoryQueryListener to removevoid addHistoryRecord(HistoryRecord record)
record
- the HistoryRecord to addvoid setStatus(int queryStatus)
queryStatus
- the new query status to setpublic java.lang.String getQueryString()
getQueryString
in interface HistoryQuery
Jitsi, the OpenSource Java VoIP and Instant Messaging client.
Distributable under Apache license.