- java.lang.Object
-
- spice.basic.Duration
-
- spice.basic.SCLKDuration
-
public class SCLKDuration extends Duration
Class SCLKDuration measures time intervals in units of SCLK ticks, where the ticks are associated with a specified clock.Version 1.0.0 27-DEC-2009 (NJB)
-
-
Constructor Summary
Constructors Constructor Description SCLKDuration(SCLKDuration d)
Copy constructor.SCLKDuration(SCLK clock, double ticks)
Construct a SCLKDuration from a clock ID and a tick count.SCLKDuration(SCLK clock, java.lang.String clkstr)
Construct a SCLKDuration from a clock ID and an SCLK duration string.SCLKDuration(SCLK clock, Duration d, Time startTime)
Create a SCLKDuration from an SCLK ID, any Duration subclass and a start time.
-
Method Summary
Modifier and Type Method Description SCLKDuration
add(SCLKDuration d)
Add a SCLKDuration to this instance.static java.lang.String
format(SCLKDuration d)
Convert a non-negative SCLKDuration to a string.double
getMeasure()
Return the measure of a SCLKDuration.Units are SCLK ticks.SCLK
getSCLK()
Return the SCLK ID of a SCLKDuration.This method returns a deep copy.double
getTDBSeconds(Time startTime)
Convert this instance to a count of TDB seconds, given a start time.SCLKDuration
negate()
Negate a SCLKDuration.SCLKDuration
scale(double s)
Scale a SCLKDuration.SCLKDuration
sub(SCLKDuration d)
Subtract a SCLKDuration from this instance.
-
-
-
Field Detail
-
clockID
private SCLK clockID
-
measure
private double measure
-
-
Constructor Detail
-
SCLKDuration
public SCLKDuration(SCLK clock, double ticks)
Construct a SCLKDuration from a clock ID and a tick count.- Parameters:
clock
- SCLKticks
- double
-
SCLKDuration
public SCLKDuration(SCLK clock, java.lang.String clkstr) throws SpiceException
Construct a SCLKDuration from a clock ID and an SCLK duration string.- Parameters:
clock
- SCLKclkstr
- String- Throws:
SpiceException
- exception
-
SCLKDuration
public SCLKDuration(SCLKDuration d)
Copy constructor.- Parameters:
d
- SCLKDuration
-
SCLKDuration
public SCLKDuration(SCLK clock, Duration d, Time startTime) throws SpiceException
Create a SCLKDuration from an SCLK ID, any Duration subclass and a start time.- Parameters:
clock
- SCLKstartTime
- Timed
- Duration- Throws:
SpiceException
- exception
-
-
Method Detail
-
getSCLK
public SCLK getSCLK() throws SpiceException
Return the SCLK ID of a SCLKDuration.This method returns a deep copy.- Returns:
- SCLK
- Throws:
SpiceException
- exception
-
getMeasure
public double getMeasure() throws SpiceException
Return the measure of a SCLKDuration.Units are SCLK ticks.- Specified by:
getMeasure
in classDuration
- Returns:
- double
- Throws:
SpiceException
- exception
-
getTDBSeconds
public double getTDBSeconds(Time startTime) throws SpiceException
Convert this instance to a count of TDB seconds, given a start time.- Specified by:
getTDBSeconds
in classDuration
- Parameters:
startTime
- Time- Returns:
- double
- Throws:
SpiceException
- exception
-
add
public SCLKDuration add(SCLKDuration d) throws SpiceException
Add a SCLKDuration to this instance.- Parameters:
d
- SCLKDuration- Returns:
- SCLKDuration
- Throws:
SpiceException
- exception
-
sub
public SCLKDuration sub(SCLKDuration d) throws SpiceException
Subtract a SCLKDuration from this instance.- Parameters:
d
- SCLKDuration- Returns:
- SCLKDuration
- Throws:
SpiceException
- exception
-
negate
public SCLKDuration negate()
Negate a SCLKDuration.
-
scale
public SCLKDuration scale(double s)
Scale a SCLKDuration.
-
format
public static java.lang.String format(SCLKDuration d) throws SpiceException
Convert a non-negative SCLKDuration to a string.Design topic: it would be convenient and expected for this functionality to be provided via an instance rather than a class method. But for that to be feasible, the method would need to work with negative durations.
So, should signed SCLK duration strings be supported?
- Parameters:
d
- SCLKDuration- Returns:
- String
- Throws:
SpiceException
- exception
-
-