Package skyview.request
Class SourceCoordinates
- java.lang.Object
-
- skyview.request.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 Summary
Constructors Constructor Description SourceCoordinates(String s, String csn, double equinox, String resolver)
ConstructorSourceCoordinates(String lon, String lat, String coords)
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description boolean
convertToCoords()
convert user input string to coordsstatic SourceCoordinates
factory(String s, String csn, double equinox, String resolver)
static SourceCoordinates
factory(String lon, String lat, String coords)
Position
getPosition()
Get the position associated with these coordinates.String
heasarcResolve()
Set up and send query to resolve source namestatic void
main(String[] args)
Test functionality.boolean
parseCoords()
extract coordinates that match coordinate system of user patch from query returnvoid
run()
send query to resolve user input
-
-
-
Constructor Detail
-
SourceCoordinates
public SourceCoordinates(String s, String csn, double equinox, String resolver)
Constructor- Parameters:
s
- text entered as coordinates or object namecsn
- name of coordinate systemequinox
- equinox of coordinate systemresolver
- resolver to be used to resolve object name
-
SourceCoordinates
public SourceCoordinates(String lon, String lat, String coords) throws IllegalArgumentException
- Throws:
IllegalArgumentException
-
-
Method Detail
-
factory
public static SourceCoordinates factory(String s, String csn, double equinox, String resolver)
-
factory
public static SourceCoordinates factory(String lon, String lat, String coords)
-
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
-
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
-
-