Class SourceCoordinates

  • All Implemented Interfaces:
    Runnable

    public class SourceCoordinates
    extends Object
    implements Runnable
    Converts user input to coordinates and returns a position object that can be used to get a position in any coordinate system. The class attempts to handle most coordinate strings locally, but object name requests are sent to the HEASARC Object name resolver. Some more exotic coordinate strings may also be handled there.
    • Constructor Detail

      • SourceCoordinates

        public SourceCoordinates​(String s,
                                 String csn,
                                 double equinox,
                                 String resolver)
        Constructor
        Parameters:
        s - text entered as coordinates or object name
        csn - name of coordinate system
        equinox - equinox of coordinate system
        resolver - resolver to be used to resolve object name
    • Method Detail

      • getPosition

        public Position getPosition()
        Get the position associated with these coordinates. /*----------------------------------------------------------------------
      • convertToCoords

        public boolean convertToCoords()
        convert user input string to coords
        Returns:
        true if coordinates were successfully resolved, false if not
      • run

        public void run()
        send query to resolve user input
        Specified by:
        run in interface Runnable
      • parseCoords

        public boolean parseCoords()
        extract coordinates that match coordinate system of user patch from query return
      • heasarcResolve

        public String heasarcResolve()
        Set up and send query to resolve source name
        Returns:
        unparsed return from HEASARC query