View Javadoc

1   /*$Id: AsuCountTwigMaker.java,v 1.1.1.1 2005/02/17 18:37:34 mch Exp $
2    * Created on 13-Nov-2003
3    *
4    * Copyright (C) AstroGrid. All rights reserved.
5    *
6    * This software is published under the terms of the AstroGrid
7    * Software License version 1.2, a copy of which has been included
8    * with this distribution in the LICENSE.txt file.
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   $Log: AsuCountTwigMaker.java,v $
42   Revision 1.1.1.1  2005/02/17 18:37:34  mch
43   Initial checkin
44  
45   Revision 1.1.1.1  2005/02/16 17:11:24  mch
46   Initial checkin
47  
48   Revision 1.1.2.1  2004/12/09 10:21:16  mch
49   added count asu maker and asu conditions
50  
51   
52   */
53  
54  
55  
56  
57