View Javadoc

1   /*$Id: Catalogues.java,v 1.1 2004/10/05 19:19:18 mch Exp $
2    * Created on 16-Oct-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.datacenter.impl.cds.sesame;
12  
13  /*** Constants class that represents catalogues to search in
14   * @author Noel Winstanley nw@jb.man.ac.uk 16-Oct-2003
15   *
16   */
17  public class Catalogues {
18  
19      /***
20       * 
21       */
22      private Catalogues(String code) {
23          this.code = code;
24      }
25      private String code;
26      
27      protected String getCode() {
28          return code;
29      }
30      /*** search in the simbad catalogue */
31      public final static Catalogues SIMBAD = new Catalogues("S");
32      /*** search in the ned catalogue */
33      public final static Catalogues NED = new Catalogues("N");
34      /*** search in the vizier catalogue */
35      public final static Catalogues VIZIER = new Catalogues("V");
36      /*** search in all catalogues */
37      public final static Catalogues ALL = new Catalogues("A");
38      
39      /*** search in two catalogues
40       * 
41       * @param a one catalogue to search in 
42       * @param b another catalogue to search in.
43       * @return code to search in both catalogues
44       */
45      public static Catalogues  BOTH(Catalogues a,Catalogues b) {
46          return new Catalogues(a.getCode() + b.getCode() + ALL.getCode());
47      }
48      
49      /*** search in a primary catalogue. If no result found, try in a fallback catalogue
50       * 
51       * @param primary first catalogue to search
52       * @param secondary seconf catalogue to search
53       * @return
54       */
55      public static Catalogues FALLBACK(Catalogues primary,Catalogues secondary) {
56          return new Catalogues(primary.getCode() + secondary.getCode());
57      }
58  
59  }
60  
61  
62  /* 
63  $Log: Catalogues.java,v $
64  Revision 1.1  2004/10/05 19:19:18  mch
65  Merged CDS implementation into PAL
66  
67  Revision 1.1  2003/11/18 11:23:49  nw
68  mavenized cds delegate
69  
70  Revision 1.1  2003/10/16 10:11:45  nw
71  first check in
72   
73  */