Module JNISpice
Package spice.basic

Class 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)

    • Field Summary

      Fields 
      Modifier and Type Field Description
      private SCLK clockID  
      private double measure  
    • 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.
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • 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 - SCLK
        ticks - 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 - SCLK
        clkstr - 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 - SCLK
        startTime - Time
        d - 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
      • 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
        Parameters:
        startTime - Time
        Returns:
        double
        Throws:
        SpiceException - exception
      • scale

        public SCLKDuration scale​(double s)
        Scale a SCLKDuration.
        Specified by:
        scale in class Duration
        Parameters:
        s - double
        Returns:
        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