diff options
author | Damian Minkov <damencho@jitsi.org> | 2014-10-14 16:55:09 +0300 |
---|---|---|
committer | Damian Minkov <damencho@jitsi.org> | 2014-10-14 17:54:23 +0300 |
commit | 124ac555f39351d639cbda9c7e9791ed3318d666 (patch) | |
tree | b748a5e059a62daaec2567289b5cf455eb617c16 /src/net/java/sip/communicator/service | |
parent | 8d69fe877734ec154ab310672a1a0889f2fed7f8 (diff) | |
download | jitsi-124ac555f39351d639cbda9c7e9791ed3318d666.zip jitsi-124ac555f39351d639cbda9c7e9791ed3318d666.tar.gz jitsi-124ac555f39351d639cbda9c7e9791ed3318d666.tar.bz2 |
Adds remove method.
Diffstat (limited to 'src/net/java/sip/communicator/service')
-rw-r--r-- | src/net/java/sip/communicator/service/contactsource/AsyncContactQuery.java | 23 |
1 files changed, 23 insertions, 0 deletions
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<T extends ContactSourceService> }
/**
+ * Removes a specific <tt>SourceContact</tt> from the list of
+ * <tt>SourceContact</tt>s.
+ *
+ * @param sourceContact the <tt>SourceContact</tt> to be removed from the
+ * <tt>queryResults</tt> of this <tt>ContactQuery</tt>
+ * @return <tt>true</tt> if the <tt>queryResults</tt> of this
+ * <tt>ContactQuery</tt> 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 <tt>SourceContact</tt> instances to the list of
* <tt>SourceContact</tt>s to be returned by this <tt>ContactQuery</tt> in
* response to {@link #getQueryResults()}.
|