public static Date getNextScheduled(Object task) {

        if (task instanceof Task) {
            final Task ltask = (Task) task;
            final long next  = ltask.isCancelled() ? 0
                                                   : ltask.getNextScheduled();

            return next == 0 ? null
                             : new Date(next);
        } else {
            return null;
        }
    }
public static Date getNextScheduled ( Object task ) { if ( task instanceof Task ) { final Task ltask = ( Task ) task ; final long next = ltask . isCancelled ( ) ? 0 : ltask . getNextScheduled ( ) ; return next == 0 ? null : new Date ( next ) ; } else { return null ; } }
Retrieves the next time the referenced task is due to be executed, as a
Date object. If the referenced task is cancelled, null is returned.

@param task a task reference
@return the next time the referenced task is due to be executed