1
0
Fork 0
mirror of https://github.com/vanitasvitae/Smack.git synced 2024-11-22 20:12:07 +01:00

Add PacketCollector.getCollectedCount()

This commit is contained in:
Florian Schmaus 2015-01-10 18:00:18 +01:00
parent e4bc6c2f37
commit 64242ace72

View file

@ -166,6 +166,7 @@ public class PacketCollector {
* until a packet is available or the <tt>timeout</tt> has elapsed. If the
* timeout elapses without a result, <tt>null</tt> will be returned.
*
* @param timeout the timeout in milliseconds.
* @return the next available packet.
*/
@SuppressWarnings("unchecked")
@ -218,6 +219,16 @@ public class PacketCollector {
return result;
}
/**
* Get the number of collected stanzas this packet collector has collected so far.
*
* @return the count of collected stanzas.
* @since 4.1
*/
public int getCollectedCount() {
return resultQueue.size();
}
/**
* Processes a packet to see if it meets the criteria for this packet collector.
* If so, the packet is added to the result queue.