Class Duration.Adapter
java.lang.Object
edu.uky.cs.nil.tt.Duration.Adapter
- All Implemented Interfaces:
Duration, Comparable<Duration>
- Enclosing interface:
Duration
An implementation of the
Duration interface.- Author:
- Stephen G. Ware
-
Nested Class Summary
Nested classes/interfaces inherited from interface Duration
Duration.Adapter, Duration.Ongoing -
Constructor Summary
ConstructorsConstructorDescriptionAdapter(long start, long end) Constructs a duration from its start and end times. -
Method Summary
Modifier and TypeMethodDescriptionintlongReturns the time this duration stopped as the number of milliseconds from the epoch (1970-01-01T00:00:00Z) in Coordinated Universal Time (UTC).longReturns the time this duration began as the number of milliseconds from the epoch (1970-01-01T00:00:00Z) in Coordinated Universal Time (UTC).toString()Methods inherited from class Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitMethods inherited from interface Duration
getDuration
-
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
-
getStartTime
public long getStartTime()Description copied from interface:DurationReturns 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:
getStartTimein interfaceDuration- Returns:
- the time this duration began
-
getEndTime
public long getEndTime()Description copied from interface:DurationReturns 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:
getEndTimein interfaceDuration- Returns:
- the time this duration stopped
-
compareTo
- Specified by:
compareToin interfaceComparable<Duration>
-