Class Timestamped.Adapter
java.lang.Object
edu.uky.cs.nil.tt.Timestamped.Adapter
- All Implemented Interfaces:
Timestamped, Comparable<Timestamped>
- Direct Known Subclasses:
Session.Event, Session.Report, Session.Result
- Enclosing interface:
Timestamped
public static class Timestamped.Adapter
extends Object
implements Timestamped, Comparable<Timestamped>
An implementation of the
Timestamped interface.- Author:
- Stephen G. Ware
-
Nested Class Summary
Nested classes/interfaces inherited from interface Timestamped
Timestamped.Adapter -
Field Summary
FieldsModifier and TypeFieldDescriptionfinal longThe time this object was created as the number of milliseconds from the epoch (1970-01-01T00:00:00Z) in Coordinated Universal Time (UTC)Fields inherited from interface Timestamped
FORMAT -
Constructor Summary
ConstructorsConstructorDescriptionAdapter()Creates a new timestamped object whose timestamp isInstant.now().Adapter(long time) Creates a new timestamped object with a given timestamp. -
Method Summary
Modifier and TypeMethodDescriptionintcompareTo(Timestamped other) longReturns the time this object was created as the number of milliseconds from the epoch (1970-01-01T00:00:00Z) in Coordinated Universal Time (UTC).
-
Field Details
-
time
public final long timeThe time this object was created as the number of milliseconds from the epoch (1970-01-01T00:00:00Z) in Coordinated Universal Time (UTC)
-
-
Constructor Details
-
Adapter
public Adapter(long time) Creates a new timestamped object with a given timestamp.- Parameters:
time- a timestamp as the number of milliseconds from the epoch (1970-01-01T00:00:00Z) in Coordinated Universal Time (UTC)
-
Adapter
public Adapter()Creates a new timestamped object whose timestamp isInstant.now().
-
-
Method Details
-
compareTo
- Specified by:
compareToin interfaceComparable<Timestamped>
-
getTimestamp
public long getTimestamp()Description copied from interface:TimestampedReturns the time this object was created as the number of milliseconds from the epoch (1970-01-01T00:00:00Z) in Coordinated Universal Time (UTC).- Specified by:
getTimestampin interfaceTimestamped- Returns:
- the object's timestamp in milliseconds from the epoch in UTC
-