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
A
duration whose end time is the present.- Author:
- Stephen G. Ware
-
Nested Class Summary
Nested classes/interfaces inherited from interface Duration
Duration.Adapter, Duration.Ongoing -
Constructor Summary
Constructors -
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
-
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
-
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>
-