Class Timesys

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

public class Timesys extends Object
Utility class for working with VOTable TIMESYS elements.
Since:
26 Apr 2019
Author:
Mark Taylor
  • Constructor Details

    • Timesys

      protected Timesys(double timeorigin, String timescale, 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 Details

    • getTimeorigin

      public double getTimeorigin()
      Returns the numeric value of time origin.
      Returns:
      JD offset in days, or NaN if no time origin
    • getTimescale

      public String getTimescale()
      Returns the timescale identifier.
      Returns:
      timescale
    • getRefposition

      public String getRefposition()
      Returns the reference position identifier.
      Returns:
      refposition
    • toString

      public String toString()
      Overrides:
      toString in class Object
      Returns:
      human-readable summary of timesys.
    • decodeTimeorigin

      public static double decodeTimeorigin(String txt) throws 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:
      NumberFormatException - if the value is not one of the magic strings and is not a valid numerical representation
    • getTimesys

      public static Timesys getTimesys(uk.ac.starlink.table.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