From 124ac555f39351d639cbda9c7e9791ed3318d666 Mon Sep 17 00:00:00 2001 From: Damian Minkov Date: Tue, 14 Oct 2014 16:55:09 +0300 Subject: Adds remove method. --- .../service/contactsource/AsyncContactQuery.java | 23 ++++++++++++++++++++++ 1 file changed, 23 insertions(+) (limited to 'src/net/java/sip/communicator/service') diff --git a/src/net/java/sip/communicator/service/contactsource/AsyncContactQuery.java b/src/net/java/sip/communicator/service/contactsource/AsyncContactQuery.java index 18dea67..2884535 100644 --- a/src/net/java/sip/communicator/service/contactsource/AsyncContactQuery.java +++ b/src/net/java/sip/communicator/service/contactsource/AsyncContactQuery.java @@ -142,6 +142,29 @@ public abstract class AsyncContactQuery } /** + * Removes a specific SourceContact from the list of + * SourceContacts. + * + * @param sourceContact the SourceContact to be removed from the + * queryResults of this ContactQuery + * @return true if the queryResults of this + * ContactQuery has changed in response to the call + */ + protected boolean removeQueryResult(SourceContact sourceContact) + { + boolean changed; + + synchronized (queryResults) + { + changed = queryResults.remove(sourceContact); + } + if (changed) + fireContactRemoved(sourceContact); + + return changed; + } + + /** * Adds a set of SourceContact instances to the list of * SourceContacts to be returned by this ContactQuery in * response to {@link #getQueryResults()}. -- cgit v1.1