Module JNISpice
Package spice.basic

Class TDTTime


  • public class TDTTime
    extends Time
    Class TDTTime implements the representation of time as seconds past J2000 TDT (Terrestrial Dynamical Time).

    A TDTTime instance can be converted to any other Time subclass by passing the instance to a constructor of that subclass.

    Class TDTTime provides a convenient way to create a Time value from a double precision number representing seconds past J2000 TDT.

    Class TDTTime also provides a convenient way to perform arithmetic using TDT time values.

    Version 1.0.0 05-DEC-2009 (NJB)

    • Field Summary

      Fields 
      Modifier and Type Field Description
      private double secPastJ2000TDT  
    • Constructor Summary

      Constructors 
      Constructor Description
      TDTTime​(double TDTsecondsPastJ2000)
      Construct a TDTTime from a double precision count of seconds past J2000 TDT.
      TDTTime​(java.lang.String timeString)
      Create a TDTTime instance from a calendar, DOY, or Julian date string accepted by STR2ET.
      TDTTime​(TDTTime t)
      Copy constructor: create a new TDTTime value from another.
      TDTTime​(Time t)
      Universal constructor: create a TDTTime from any Time instance.
    • Method Summary

      Modifier and Type Method Description
      TDTTime add​(Duration d)
      Add a Duration to a TDTTime.
      boolean equals​(java.lang.Object obj)
      Test two TDTTimes for equality.
      double getTDBSeconds()
      Express a TDTTime as a count of TDB seconds past J2000 TDB.
      double getTDTSeconds()
      Retrieve seconds past J2000 TDT.
      int hashCode()
      Return hash code for a TDBTime object.This method is overridden to support the overridden equals( Object ) method.
      TDTTime sub​(Duration d)
      Subtract a Duration from a TDTTime.
      TDTDuration sub​(Time t)
      Subtract a Time instance from this TDTTime, producing a TDTDuration.
      java.lang.String toString()
      Convert a TDTTime to a formatted time string using a default picture.Note: this method overrides Object's "toString" method, and as such cannot throw a SpiceErrorException.
      java.lang.String toString​(java.lang.String picture)
      Convert a TDTTime to a formatted time string using a format picture accepted by TIMOUT.
      java.lang.String toUTCString​(java.lang.String format, int precision)
      Convert a TDBTime to a formatted time string using a format code and an integer precision level for fractional seconds.
      • Methods inherited from class java.lang.Object

        clone, finalize, getClass, notify, notifyAll, wait, wait, wait
    • Field Detail

      • secPastJ2000TDT

        private double secPastJ2000TDT
    • Constructor Detail

      • TDTTime

        public TDTTime​(double TDTsecondsPastJ2000)
        Construct a TDTTime from a double precision count of seconds past J2000 TDT.
        Parameters:
        TDTsecondsPastJ2000 -
      • TDTTime

        public TDTTime​(java.lang.String timeString)
                throws SpiceException
        Create a TDTTime instance from a calendar, DOY, or Julian date string accepted by STR2ET.
        Parameters:
        timeString -
        Throws:
        SpiceException
      • TDTTime

        public TDTTime​(TDTTime t)
        Copy constructor: create a new TDTTime value from another.
        Parameters:
        t -
      • TDTTime

        public TDTTime​(Time t)
                throws SpiceException
        Universal constructor: create a TDTTime from any Time instance.

        This constructor performs all supported time conversions that produce a result expressed as seconds past J2000 TDT.

        Parameters:
        t -
        Throws:
        SpiceException
    • Method Detail

      • getTDTSeconds

        public double getTDTSeconds()
        Retrieve seconds past J2000 TDT.
        Returns:
      • equals

        public boolean equals​(java.lang.Object obj)
        Test two TDTTimes for equality.
        Overrides:
        equals in class java.lang.Object
        Returns:
      • hashCode

        public int hashCode()
        Return hash code for a TDBTime object.This method is overridden to support the overridden equals( Object ) method.
        Overrides:
        hashCode in class java.lang.Object
        Returns:
      • toString

        public java.lang.String toString​(java.lang.String picture)
                                  throws SpiceException
        Convert a TDTTime to a formatted time string using a format picture accepted by TIMOUT.
        Parameters:
        picture -
        Returns:
        Throws:
        SpiceException
      • toUTCString

        public java.lang.String toUTCString​(java.lang.String format,
                                            int precision)
                                     throws SpiceException
        Convert a TDBTime to a formatted time string using a format code and an integer precision level for fractional seconds.
        Parameters:
        format -
        precision -
        Returns:
        Throws:
        SpiceException
      • toString

        public java.lang.String toString()
        Convert a TDTTime to a formatted time string using a default picture.Note: this method overrides Object's "toString" method, and as such cannot throw a SpiceErrorException. Instead, if a conversion error occurs, the associated message is returned.
        Overrides:
        toString in class java.lang.Object
        Returns: