aboutsummaryrefslogtreecommitdiff
path: root/vendor/voclient/libvoclient/examples/resolver.java
diff options
context:
space:
mode:
authorJoseph Hunkeler <jhunkeler@gmail.com>2015-07-08 20:46:52 -0400
committerJoseph Hunkeler <jhunkeler@gmail.com>2015-07-08 20:46:52 -0400
commitfa080de7afc95aa1c19a6e6fc0e0708ced2eadc4 (patch)
treebdda434976bc09c864f2e4fa6f16ba1952b1e555 /vendor/voclient/libvoclient/examples/resolver.java
downloadiraf-linux-fa080de7afc95aa1c19a6e6fc0e0708ced2eadc4.tar.gz
Initial commit
Diffstat (limited to 'vendor/voclient/libvoclient/examples/resolver.java')
-rw-r--r--vendor/voclient/libvoclient/examples/resolver.java32
1 files changed, 32 insertions, 0 deletions
diff --git a/vendor/voclient/libvoclient/examples/resolver.java b/vendor/voclient/libvoclient/examples/resolver.java
new file mode 100644
index 00000000..519746e9
--- /dev/null
+++ b/vendor/voclient/libvoclient/examples/resolver.java
@@ -0,0 +1,32 @@
+
+// Test program for the VOCSesame class.
+//
+// Assuming the NVOSS classpath and working from this directory:
+//
+// % javac -classpath ../../lib/voclient.jar:$CLASSPATH resolver.java
+// % java -classpath ../../lib/voclient.jar:$CLASSPATH resolver m51
+//
+
+import voclient.*;
+
+public class resolver {
+
+ public static void main (String[] args) {
+
+ // Require a target name
+ if (args.length == 0) {
+ System.out.println ("Usage: resolve <target>");
+ System.exit (0);
+ }
+
+ // Invoke the service in the constructor so we can just use the result.
+ VOCSesame sr = new VOCSesame (args[0]);
+
+ // The following two lines should produce the same results.
+ System.out.println ( "target = "+ sr.target +
+ " ra = "+ sr.ra + " dec = "+ sr.dec + " (" + sr.pos + ")");
+ System.out.println ( "target = "+ sr.getTarget() +
+ " ra = "+ sr.getRa() + " dec = "+ sr.getDec() +
+ " (" + sr.pos + ")" );
+ }
+}