1
2
3
4
5
6
7
8
9
10
11 package org.astrogrid.dataservice.impl.cds;
12
13 import java.io.IOException;
14 import org.astrogrid.query.returns.ReturnSpec;
15
16 /*** Makes an ASU URL 'twig' that can be attached to a URL stem to query
17 * an ASU-compatible server for returning the number of matches.
18 * <p>
19 * @see http://vizier.u-strasbg.fr/doc/asu.html
20 * <p>
21 * @author M Hill
22 */
23 public class AsuCountTwigMaker extends AsuTwigMaker {
24
25 /*** do nothing - don't limit counts :-) */
26 public void visitLimit(long limit) throws IOException {
27 if (limit>0) {
28 asuTwig.append("-out.max="+limit);
29 }
30 }
31
32 /*** Return spec is to return a count */
33 public void visitReturnSpec(ReturnSpec spec) {
34 asuTwig.append("&-out.exists");
35 }
36
37 }
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57