- java.lang.Object
-
- spice.basic.Time
-
- spice.basic.JEDTime
-
public class JEDTime extends Time
Class JEDime represents times as Julian ephemeris dates.Version 1.0.0 22-DEC-2009 (NJB)
-
-
Field Summary
Fields Modifier and Type Field Description private double
JED
-
Constructor Summary
Constructors Constructor Description JEDTime(double JED)
Construct a JEDTime from a double precision Julian ephemeris date having units of Julian days.JEDTime(JEDTime t)
Copy constructor: create a new JEDTime value from another.JEDTime(Time t)
Universal constructor: create a JEDTime from anyTime
instance.
-
Method Summary
Modifier and Type Method Description JEDTime
add(Duration d)
Add a Duration to a JEDTime.boolean
equals(java.lang.Object obj)
Test two JEDTimes for equality.double
getDays()
Get the scalar count of days stored in this JED instance.double
getTDBSeconds()
Express a JEDTime as a count of TDB seconds past J2000 TDB.int
hashCode()
Return hash code for a JEDTime object.This method is overridden to support the overridden equals( Object ) method.JEDTime
sub(Duration d)
Subtract a Duration from a JEDTime.JEDDuration
sub(Time t)
Subtract aTime
instance from this JEDTime, producing a JEDDuration.java.lang.String
toString()
Convert a JEDTime 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 JEDTime to a formatted time string using a format picture.The format picture may be any supported by the SPICE routine TIMOUT.java.lang.String
toUTCString(java.lang.String format, int precision)
Convert a JEDTime to a formatted time string using a format code and an integer precision level for fractional seconds.
-
-
-
Constructor Detail
-
JEDTime
public JEDTime(double JED)
Construct a JEDTime from a double precision Julian ephemeris date having units of Julian days.Note that the input is a primitive type, so no semantic checking is possible. The user must ensure that the input value has the correct reference epoch and time system.
- Parameters:
JED
- double
-
JEDTime
public JEDTime(JEDTime t)
Copy constructor: create a new JEDTime value from another.- Parameters:
t
- JEDTime
-
JEDTime
public JEDTime(Time t) throws SpiceException
Universal constructor: create a JEDTime from anyTime
instance.This constructor performs all supported time conversions that produce a result expressed as seconds past J2000 TDB.
- Parameters:
t
- Time- Throws:
SpiceException
- exception
-
-
Method Detail
-
getDays
public double getDays()
Get the scalar count of days stored in this JED instance.- Returns:
- double
-
sub
public JEDDuration sub(Time t) throws SpiceException
Subtract aTime
instance from this JEDTime, producing a JEDDuration.- Specified by:
sub
in classTime
- Parameters:
t
- Time- Returns:
- JEDDuration
- Throws:
SpiceException
- exception
-
add
public JEDTime add(Duration d) throws SpiceException
Add a Duration to a JEDTime.- Specified by:
add
in classTime
- Parameters:
d
- Duration- Returns:
- JEDTime
- Throws:
SpiceException
- exception
-
sub
public JEDTime sub(Duration d) throws SpiceException
Subtract a Duration from a JEDTime.- Specified by:
sub
in classTime
- Parameters:
d
- Duration- Returns:
- JEDTime
- Throws:
SpiceException
- exception
-
equals
public boolean equals(java.lang.Object obj)
Test two JEDTimes for equality.- Overrides:
equals
in classjava.lang.Object
- Returns:
- boolean
-
hashCode
public int hashCode()
Return hash code for a JEDTime object.This method is overridden to support the overridden equals( Object ) method.- Overrides:
hashCode
in classjava.lang.Object
- Returns:
- int
-
toString
public java.lang.String toString(java.lang.String picture) throws SpiceErrorException
Convert a JEDTime to a formatted time string using a format picture.The format picture may be any supported by the SPICE routine TIMOUT.- Parameters:
picture
- String- Returns:
- String
- Throws:
SpiceErrorException
- exception
-
toUTCString
public java.lang.String toUTCString(java.lang.String format, int precision) throws SpiceErrorException
Convert a JEDTime to a formatted time string using a format code and an integer precision level for fractional seconds.- Parameters:
format
- Stringprecision
- int- Returns:
- String
- Throws:
SpiceErrorException
- exception
-
toString
public java.lang.String toString()
Convert a JEDTime 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:
- String
-
getTDBSeconds
public double getTDBSeconds()
Express a JEDTime as a count of TDB seconds past J2000 TDB.- Specified by:
getTDBSeconds
in classTime
- Returns:
- double
-
-