Package org.yamcs.time
Class Instant
java.lang.Object
org.yamcs.time.Instant
- All Implemented Interfaces:
Comparable<Instant>
Yamcs high resolution instant storing milliseconds since 1970-01-01T00:00:00 TAI (including leap seconds) and
picoseconds.
Most of the Yamcs classes use just the milliseconds.
-
Field Summary
Fields -
Method Summary
Modifier and TypeMethodDescriptionintdoubleCompute the distance in seconds between this instant and the given instant.booleanstatic Instantget(long millis) Returns a new instant with the given milliseconds and the picos 0static Instantget(long millis, long picos) Create a new instant given the number of milliseconds and the number of picosecondslongintgetPicos()inthashCode()plus(double secs) Add the given number of seconds to this and return the resultAdd the given instant to this and return the result.toString()
-
Field Details
-
INVALID_INSTANT
-
MIN_INSTANT
public static final long MIN_INSTANT- See Also:
-
MAX_INSTANT
public static final long MAX_INSTANT- See Also:
-
-
Method Details
-
get
Create a new instant given the number of milliseconds and the number of picoseconds- Parameters:
millis-picos-- Returns:
-
get
Returns a new instant with the given milliseconds and the picos 0- Parameters:
millis-- Returns:
-
getMillis
public long getMillis() -
getPicos
public int getPicos() -
plus
Add the given instant to this and return the result.- Parameters:
t-- Returns:
-
plus
Add the given number of seconds to this and return the result- Parameters:
secs-- Returns:
-
deltaFrom
Compute the distance in seconds between this instant and the given instant.- Parameters:
t-- Returns:
-
compareTo
- Specified by:
compareToin interfaceComparable<Instant>
-
hashCode
public int hashCode() -
equals
-
toString
-