Package com.marswars.proxy_server
Class Packet.Timestamp
java.lang.Object
com.marswars.proxy_server.Packet.Timestamp
- Enclosing interface:
- Packet
Timestamp class to store packet timestamp and perform timestamp operations.
Contains seconds and nanoseconds components for high-precision timing.
-
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionbooleandoubleGets the timestamp as a single double value in seconds.inthashCode()booleanisMoreRecentThan(Packet.Timestamp other) Determines if this timestamp is more recent than the provided timestamp.toString()
-
Field Details
-
seconds
public final int seconds -
nanoseconds
public final int nanoseconds
-
-
Constructor Details
-
Timestamp
public Timestamp(int seconds, int nanoseconds)
-
-
Method Details
-
isMoreRecentThan
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
-
equals
-
hashCode
public int hashCode()
-