Class Duration.Adapter

java.lang.Object
edu.uky.cs.nil.tt.Duration.Adapter
All Implemented Interfaces:
Duration, Comparable<Duration>
Enclosing interface:
Duration

public static class Duration.Adapter extends Object implements Duration, Comparable<Duration>
An implementation of the Duration interface.
Author:
Stephen G. Ware
  • Constructor Details

    • Adapter

      public Adapter(long start, long end)
      Constructs a duration from its start and end times.
      Parameters:
      start - the start time as the number of milliseconds from the epoch (1970-01-01T00:00:00Z) in Coordinated Universal Time (UTC)
      end - the end 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>