Class Instant

java.lang.Object
org.yamcs.time.Instant
All Implemented Interfaces:
Comparable<Instant>

public class Instant extends Object implements 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 Details

  • Method Details

    • get

      public static Instant get(long millis, long picos)
      Create a new instant given the number of milliseconds and the number of picoseconds
      Parameters:
      millis -
      picos -
      Returns:
    • get

      public static Instant get(long millis)
      Returns a new instant with the given milliseconds and the picos 0
      Parameters:
      millis -
      Returns:
    • getMillis

      public long getMillis()
    • getPicos

      public int getPicos()
    • plus

      public Instant plus(Instant t)
      Add the given instant to this and return the result.
      Parameters:
      t -
      Returns:
    • plus

      public Instant plus(double secs)
      Add the given number of seconds to this and return the result
      Parameters:
      secs -
      Returns:
    • deltaFrom

      public double deltaFrom(Instant t)
      Compute the distance in seconds between this instant and the given instant.
      Parameters:
      t -
      Returns:
    • compareTo

      public int compareTo(Instant o)
      Specified by:
      compareTo in interface Comparable<Instant>
    • hashCode

      public int hashCode()
      Overrides:
      hashCode in class Object
    • equals

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

      public String toString()
      Overrides:
      toString in class Object