Added isEmpty().

git-svn-id: https://samskivert.googlecode.com/svn/trunk@2605 6335cc39-0255-0410-8fd6-9bcaacd3b74c
This commit is contained in:
samskivert
2009-08-11 21:08:47 +00:00
parent e721f79227
commit b2acdc7393
+11
View File
@@ -153,6 +153,17 @@ public class Invoker extends LoopingThread
_queue.append(unit);
}
/**
* Returns true if this invoker has no pending units, false if it has pending units.
* <em>Note:</em> this does not account for whether a unit is <em>currently</em> being
* processed, so if you want to guarantee that an invoker is empty, it's best to call this
* method in a unit being processed by that invoker.
*/
public boolean isEmpty ()
{
return _queue.size() == 0;
}
// from RunQueue
public void postRunnable (final Runnable r)
{