JNISpice
version 2.0.0

spice.basic
Class SCLKDuration

java.lang.Object
  extended by spice.basic.Duration
      extended by 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
SCLKDuration(SCLK clock, double ticks)
          Construct a SCLKDuration from a clock ID and a tick count.
SCLKDuration(SCLKDuration d)
          Copy constructor.
SCLKDuration(SCLK clock, Duration d, Time startTime)
          Create a SCLKDuration from an SCLK ID, any Duration subclass and a start time.
SCLKDuration(SCLK clock, java.lang.String clkstr)
          Construct a SCLKDuration from a clock ID and an SCLK duration string.
 
Method Summary
 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.
 SCLK getSCLK()
          Return the SCLK ID of a SCLKDuration.
 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.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

SCLKDuration

public SCLKDuration(SCLK clock,
                    double ticks)
Construct a SCLKDuration from a clock ID and a tick count.


SCLKDuration

public SCLKDuration(SCLK clock,
                    java.lang.String clkstr)
             throws SpiceException
Construct a SCLKDuration from a clock ID and an SCLK duration string.

Throws:
SpiceException

SCLKDuration

public SCLKDuration(SCLKDuration d)
Copy constructor.


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.

Throws:
SpiceException
Method Detail

getSCLK

public SCLK getSCLK()
             throws SpiceException
Return the SCLK ID of a SCLKDuration. This method returns a deep copy.

Throws:
SpiceException

getMeasure

public double getMeasure()
                  throws SpiceException
Return the measure of a SCLKDuration. Units are SCLK ticks.

Specified by:
getMeasure in class Duration
Throws:
SpiceException

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 class Duration
Throws:
SpiceException

add

public SCLKDuration add(SCLKDuration d)
                 throws SpiceException
Add a SCLKDuration to this instance.

Throws:
SpiceException

sub

public SCLKDuration sub(SCLKDuration d)
                 throws SpiceException
Subtract a SCLKDuration from this instance.

Throws:
SpiceException

negate

public SCLKDuration negate()
Negate a SCLKDuration.

Specified by:
negate in class Duration

scale

public SCLKDuration scale(double s)
Scale a SCLKDuration.

Specified by:
scale in class Duration

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?

Throws:
SpiceException

JNISpice
version 2.0.0

JNISpice Alpha Test Version 2.0.0 28-JAN-2017 (NJB)