mirror of
https://github.com/vanitasvitae/Smack.git
synced 2024-11-22 12:02:05 +01:00
Add PacketCollector.getCollectedCount()
This commit is contained in:
parent
e4bc6c2f37
commit
64242ace72
1 changed files with 11 additions and 0 deletions
|
@ -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.
|
||||
|
|
Loading…
Reference in a new issue