Class Duration.Ongoing

java.lang.Object
edu.uky.cs.nil.tt.Duration.Ongoing
All Implemented Interfaces:
Duration, Comparable<Duration>
Direct Known Subclasses:
ServerStatus.Playing, ServerStatus.Waiting
Enclosing interface:
Duration

public static class Duration.Ongoing extends Object implements Duration, Comparable<Duration>
A duration whose end time is the present.
Author:
Stephen G. Ware
  • Constructor Details

    • Ongoing

      public Ongoing(long start)
      Constructs an ongoing duration from its start time.
      Parameters:
      start - the start time as the number of milliseconds from the epoch (1970-01-01T00:00:00Z) in Coordinated Universal Time (UTC)
  • Method Details

    • toString

      public String toString()
      Overrides:
      toString in class Object
    • getStartTime

      public long getStartTime()
      Description copied from interface: Duration
      Returns the time this duration began as the number of milliseconds from the epoch (1970-01-01T00:00:00Z) in Coordinated Universal Time (UTC).
      Specified by:
      getStartTime in interface Duration
      Returns:
      the time this duration began
    • getEndTime

      public long getEndTime()
      Description copied from interface: Duration
      Returns the time this duration stopped as the number of milliseconds from the epoch (1970-01-01T00:00:00Z) in Coordinated Universal Time (UTC).
      Specified by:
      getEndTime in interface Duration
      Returns:
      the time this duration stopped
    • compareTo

      public int compareTo(Duration other)
      Specified by:
      compareTo in interface Comparable<Duration>