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

    Fields
    Modifier and Type
    Field
    Description
    final long
    The 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

    Constructors
    Constructor
    Description
    Creates a new timestamped object whose timestamp is Instant.now().
    Adapter(long time)
    Creates a new timestamped object with a given timestamp.
  • Method Summary

    Modifier and Type
    Method
    Description
    int
     
    long
    Returns the time this object was created as the number of milliseconds from the epoch (1970-01-01T00:00:00Z) in Coordinated Universal Time (UTC).

    Methods inherited from class Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Field Details

    • time

      public final long time
      The 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 is Instant.now().
  • Method Details

    • compareTo

      public int compareTo(Timestamped other)
      Specified by:
      compareTo in interface Comparable<Timestamped>
    • getTimestamp

      public long getTimestamp()
      Description copied from interface: Timestamped
      Returns 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:
      getTimestamp in interface Timestamped
      Returns:
      the object's timestamp in milliseconds from the epoch in UTC