Class Deadline

    • Method Detail

      • plus

        public Deadline plus​(java.time.Duration other)
      • timeLeft

        public java.time.Duration timeLeft()
        Returns the time left between the deadline and now. The result is negative if the deadline has passed.
      • hasTimeLeft

        public boolean hasTimeLeft()
        Returns whether there is any time left between the deadline and now.
      • isOverdue

        public boolean isOverdue()
        Determines whether the deadline is in the past, i.e. whether the time left is zero or negative.
      • now

        public static Deadline now()
        Constructs a Deadline that has now as the deadline. Use this and then extend via plus(Duration) to specify a deadline in the future.
      • fromNow

        public static Deadline fromNow​(java.time.Duration duration)
        Constructs a Deadline that is a given duration after now.
      • fromNowWithClock

        public static Deadline fromNowWithClock​(java.time.Duration duration,
                                                Clock clock)
        Constructs a Deadline that is a given duration after now, where now and all other times from this deadline are defined by the given Clock.
        Parameters:
        duration - Duration for this deadline.
        clock - Time provider for this deadline.