uk.ac.starlink.votable

## Class Timesys

- java.lang.Object
- - uk.ac.starlink.votable.Timesys

-     public class Timesys
      extends java.lang.Object

  Utility class for working with VOTable TIMESYS elements.
  Since:
    26 Apr 2019

- - ### Constructor Summary

    Constructors
    Modifier | Constructor and Description
    --- | ---
    `protected` | `Timesys(double timeorigin, java.lang.String timescale, java.lang.String refposition)` Constructor.

  - ### Method Summary

    All Methods Static Methods Instance Methods Concrete Methods
    Modifier and Type | Method and Description
    --- | ---
    `static double` | `decodeTimeorigin(java.lang.String txt)` Turns the value string found in the TIMESYS/@timeorigin attribute into a numeric value giving JD offset in days.
    `java.lang.String` | `getRefposition()` Returns the reference position identifier.
    `double` | `getTimeorigin()` Returns the numeric value of time origin.
    `java.lang.String` | `getTimescale()` Returns the timescale identifier.
    `static Timesys` | `getTimesys(ValueInfo info)` Extracts a Timesys instance from a ValueInfo.
    `java.lang.String` | `toString()`

    - ### Methods inherited from class java.lang.Object

      `clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait`

- - ### Constructor Detail

    - #### Timesys

          protected Timesys(double timeorigin,
                            java.lang.String timescale,
                            java.lang.String refposition)

      Constructor.
      Parameters:
        `timeorigin` - numeric value of time origin (JD offset); if the timeys doesn't have one, use NaN
        `timescale` - timescale value
        `refposition` - refposition value

  - ### Method Detail

    - #### getTimeorigin

          public double getTimeorigin()

      Returns the numeric value of time origin.
      Returns:
        JD offset in days, or NaN if no time origin

    - #### getTimescale

          public java.lang.String getTimescale()

      Returns the timescale identifier.
      Returns:
        timescale

    - #### getRefposition

          public java.lang.String getRefposition()

      Returns the reference position identifier.
      Returns:
        refposition

    - #### toString

          public java.lang.String toString()

      Overrides:
        `toString` in class `java.lang.Object`
      Returns:
        human-readable summary of timesys.

    - #### decodeTimeorigin

          public static double decodeTimeorigin(java.lang.String txt)
                                         throws java.lang.NumberFormatException

      Turns the value string found in the TIMESYS/@timeorigin attribute into a numeric value giving JD offset in days. If the text is not legal for the timeorigin attribute, a NumberFormatException will be thrown.
      Parameters:
        `txt` - timeorigin attribute value
      Returns:
        numeric offset value
      Throws:
        `java.lang.NumberFormatException` - if the value is not one of the magic strings and is not a valid numerical representation

    - #### getTimesys

          public static Timesys getTimesys(ValueInfo info)

      Extracts a Timesys instance from a ValueInfo. If the metadata contains insufficient or incorrect information to define a Timesys, null is returned.
      Parameters:
        `info` - value metadata
      Returns:
        timesys instance or null