- java.lang.Object
-
- spice.basic.Time
-
- spice.basic.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 anyTime
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 aTime
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.
-
-
-
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 anyTime
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:
-
sub
public TDTDuration sub(Time t) throws SpiceException
Subtract aTime
instance from this TDTTime, producing a TDTDuration.- Specified by:
sub
in classTime
- Parameters:
t
-- Returns:
- Throws:
SpiceException
-
add
public TDTTime add(Duration d) throws SpiceException
Add a Duration to a TDTTime.- Specified by:
add
in classTime
- Parameters:
d
-- Returns:
- Throws:
SpiceException
-
sub
public TDTTime sub(Duration d) throws SpiceException
Subtract a Duration from a TDTTime.- Specified by:
sub
in classTime
- Parameters:
d
-- Returns:
- Throws:
SpiceException
-
equals
public boolean equals(java.lang.Object obj)
Test two TDTTimes for equality.- Overrides:
equals
in classjava.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 classjava.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 classjava.lang.Object
- Returns:
-
getTDBSeconds
public double getTDBSeconds() throws SpiceException
Express a TDTTime as a count of TDB seconds past J2000 TDB.- Specified by:
getTDBSeconds
in classTime
- Returns:
- Throws:
SpiceException
-
-