Make it possible to supply a RunQueue after the fact for callers who have a
RunQueue that might be null. git-svn-id: https://samskivert.googlecode.com/svn/trunk@2530 6335cc39-0255-0410-8fd6-9bcaacd3b74c
This commit is contained in:
@@ -69,6 +69,17 @@ public abstract class Interval
|
|||||||
* method. If null is supplied the interval will be run directly on the timer thread.
|
* method. If null is supplied the interval will be run directly on the timer thread.
|
||||||
*/
|
*/
|
||||||
public Interval (RunQueue runQueue)
|
public Interval (RunQueue runQueue)
|
||||||
|
{
|
||||||
|
setRunQueue(runQueue);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Configures the run queue to be used by this interval. This <em>must</em> be called before
|
||||||
|
* the interval is started and a non-null queue must be provided. This exists for situations
|
||||||
|
* where the caller needs to configure an optional run queue and thus can't easily call the
|
||||||
|
* appropriate constructor.
|
||||||
|
*/
|
||||||
|
public void setRunQueue (RunQueue runQueue)
|
||||||
{
|
{
|
||||||
if (runQueue == null) {
|
if (runQueue == null) {
|
||||||
throw new IllegalArgumentException("Supplied RunQueue must be non-null");
|
throw new IllegalArgumentException("Supplied RunQueue must be non-null");
|
||||||
|
|||||||
Reference in New Issue
Block a user