Class Packet.Timestamp

java.lang.Object
com.marswars.proxy_server.Packet.Timestamp
Enclosing interface:
Packet

public static class Packet.Timestamp extends Object
Timestamp class to store packet timestamp and perform timestamp operations. Contains seconds and nanoseconds components for high-precision timing.
  • Field Details

    • seconds

      public final int seconds
    • nanoseconds

      public final int nanoseconds
  • Constructor Details

    • Timestamp

      public Timestamp(int seconds, int nanoseconds)
  • Method Details

    • isMoreRecentThan

      public boolean isMoreRecentThan(Packet.Timestamp other)
      Determines if this timestamp is more recent than the provided timestamp.
      Parameters:
      other - the timestamp to compare against
      Returns:
      true if this timestamp is more recent, false otherwise
    • getSeconds

      public double getSeconds()
      Gets the timestamp as a single double value in seconds. Combines the seconds and nanoseconds into a single floating-point value.
      Returns:
      the timestamp in seconds (with nanosecond precision)
    • toString

      public String toString()
      Overrides:
      toString in class Object
    • equals

      public boolean equals(Object obj)
      Overrides:
      equals in class Object
    • hashCode

      public int hashCode()
      Overrides:
      hashCode in class Object