diff --git a/src/java/com/samskivert/util/Interval.java b/src/java/com/samskivert/util/Interval.java index 8062187f..fa656c8e 100644 --- a/src/java/com/samskivert/util/Interval.java +++ b/src/java/com/samskivert/util/Interval.java @@ -20,6 +20,7 @@ package com.samskivert.util; +import java.util.Date; import java.util.Timer; import java.util.TimerTask; @@ -77,6 +78,15 @@ public abstract class Interval */ public abstract void expired (); + /** + * Schedules this interval to execute once at when. Supersedes any previous + * schedule that this Interval may have had. + */ + public final void schedule (Date when) + { + 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.