From 2868785c8f57a24ebd0a04cdf540238f7661d5db Mon Sep 17 00:00:00 2001 From: samskivert Date: Sun, 4 Oct 2009 23:26:00 +0000 Subject: [PATCH] Alas, changing the schedule() signature breaks a ton of Game Gardens games, so I'm rolling back the fluency addition. It's not sufficiently useful to merit the breakage, especially since you can do (_foo = new Interval()).schedule() to achieve much the same effect. Boo for backwards binary compatibility. git-svn-id: https://samskivert.googlecode.com/svn/trunk@2641 6335cc39-0255-0410-8fd6-9bcaacd3b74c --- src/java/com/samskivert/util/Interval.java | 30 +++++++--------------- 1 file changed, 9 insertions(+), 21 deletions(-) diff --git a/src/java/com/samskivert/util/Interval.java b/src/java/com/samskivert/util/Interval.java index 8c913be6..518e5065 100644 --- a/src/java/com/samskivert/util/Interval.java +++ b/src/java/com/samskivert/util/Interval.java @@ -123,23 +123,19 @@ public abstract class Interval /** * Schedules this interval to execute once at when. Supersedes any previous * schedule that this Interval may have had. - * - * @return this for convenient method chaining. */ - public final Interval schedule (Date when) + public final void schedule (Date when) { - return schedule(when.getTime() - System.currentTimeMillis()); + schedule(when.getTime() - System.currentTimeMillis()); } /** * Schedule the interval to execute once, after the specified delay. Supersedes any previous * schedule that this Interval may have had. - * - * @return this for convenient method chaining. */ - public final Interval schedule (long delay) + public final void schedule (long delay) { - return schedule(delay, 0L); + schedule(delay, 0L); } /** @@ -149,12 +145,10 @@ public abstract class Interval *

Note: if a repeating interval is scheduled to post itself to a RunQueue and the target * RunQueue is shutdown when the interval expires, the interval will cancel itself and log a * warning message.

- * - * @return this for convenient method chaining. */ - public final Interval schedule (long delay, boolean repeat) + public final void schedule (long delay, boolean repeat) { - return schedule(delay, repeat ? delay : 0L); + schedule(delay, repeat ? delay : 0L); } /** @@ -165,12 +159,10 @@ public abstract class Interval *

Note: if a repeating interval is scheduled to post itself to a RunQueue and the target * RunQueue is shutdown when the interval expires, the interval will cancel itself and log a * warning message.

- * - * @return this for convenient method chaining. */ - public final Interval schedule (long initialDelay, long repeatDelay) + public final void schedule (long initialDelay, long repeatDelay) { - return schedule(initialDelay, repeatDelay, true); + schedule(initialDelay, repeatDelay, true); } /** @@ -187,13 +179,11 @@ public abstract class Interval * {@link Timer#schedule(TimerTask, long, long)} which ensures that there will be close to * repeateDelay milliseconds between expirations. * - * @return this for convenient method chaining. - * * @exception IllegalArgumentException if fixedRate is false and a RunQueue has been specified. * That doesn't make sense because the fixed delay cannot account for the time that the * RunBuddy sits on the RunQueue waiting to call expire(). */ - public final Interval schedule (long initialDelay, long repeatDelay, boolean fixedRate) + public final void schedule (long initialDelay, long repeatDelay, boolean fixedRate) { cancel(); IntervalTask task = new IntervalTask(this); @@ -212,8 +202,6 @@ public abstract class Interval _timer = createTimer(); scheduleTask(initialDelay, repeatDelay, fixedRate); } - - return this; } /**