cds.simbad.ident
Class CatalogTable

java.lang.Object
  extended bycds.simbad.ident.CatalogTable

public class CatalogTable
extends java.lang.Object

Liste des catalogues avec leurs synonymes


Field Summary
private static java.util.HashMap catlist
           
private static java.util.ArrayList cats
           
private static CatalogTable catTable
           
private static boolean isFullTable
           
private static int MAX_CAT_COUNT
           
 
Constructor Summary
private CatalogTable(java.lang.String filename, boolean full)
          Constructor: loads the catalogue table defined by its filename.
 
Method Summary
 void addCatalog(java.lang.String name, Catalog cat)
          Add a catalog object to the table
static CatalogTable createCatalogTable(java.lang.String filename)
          loads the catalogue table defined by its filename.
static CatalogTable createFullCatalogTable(java.lang.String filename)
          loads the full catalogue table defined by its filename.
 Catalog getCatalog(java.lang.String name)
          returns the catalogue specified by the name ONLY if it is unique
 java.util.ArrayList getCatalogList(java.lang.String name)
          get all the catalogs having a given name
static CatalogTable getCatalogTable()
          Static method for accessing the catalogTable object
 int getCount()
          Number of catalogue names, including synonyms
 java.util.Iterator iterator()
          Gets an iterator on the catalog objects.
 java.lang.String toRE()
          Retourne la liste des expressions regulieres pour chaque catalogue
 java.lang.String toString()
           
 void writeTable(java.lang.String filename)
          Write the catalogue description file
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

MAX_CAT_COUNT

private static final int MAX_CAT_COUNT
See Also:
Constant Field Values

catTable

private static CatalogTable catTable

catlist

private static java.util.HashMap catlist

cats

private static java.util.ArrayList cats

isFullTable

private static boolean isFullTable
Constructor Detail

CatalogTable

private CatalogTable(java.lang.String filename,
                     boolean full)
              throws IdentifierDescriptionException
Constructor: loads the catalogue table defined by its filename.
A catalog definition contains the following entries:

Parameters:
filename - name of the file containing the catalogue descriptions
full - true if all items should be loaded in a catalogFull object false if only the catalog object is enough for normalisation.
Throws:
IdentifierDescriptionException
Method Detail

createCatalogTable

public static CatalogTable createCatalogTable(java.lang.String filename)
                                       throws IdentifierDescriptionException
loads the catalogue table defined by its filename. Only a part of the catalogues dat, needed for normalisation and related tasks, is loaded. To load the full table, see createFullCatalogTable.
If the catalogue table is already loaded, it is returned by the method

Parameters:
filename - name of the file containing the catalogue descriptions
Returns:
the catalog table
Throws:
IdentifierDescriptionException

createFullCatalogTable

public static CatalogTable createFullCatalogTable(java.lang.String filename)
                                           throws IdentifierDescriptionException
loads the full catalogue table defined by its filename. The full catalogue table is requested for updating - and rewriting - the table.
If the catalogue table is already loaded, its reference is returned by the method.

Parameters:
filename - name of the file containing the catalogue descriptions
Returns:
the catalog table
Throws:
IdentifierDescriptionException

iterator

public java.util.Iterator iterator()
Gets an iterator on the catalog objects.
This method is only available if the full catalogs have been loaded

Returns:
an iterator on the catalogs arraylist. Returns null if only the partial catalogs have been loaded

addCatalog

public void addCatalog(java.lang.String name,
                       Catalog cat)
Add a catalog object to the table

Parameters:
name - standard name of the catalogue. If the catalogue name is with brackets, the name without the braquets will also be added.
cat - catalog object to add to the list

getCatalogList

public java.util.ArrayList getCatalogList(java.lang.String name)
get all the catalogs having a given name

Parameters:
name - catalog name.
Returns:
a vector with all the catalogue objects

getCatalog

public Catalog getCatalog(java.lang.String name)
returns the catalogue specified by the name ONLY if it is unique

Parameters:
name - catalogue name
Returns:
the catalogue object if only one exists for the given name null either if the name does not exist, or if there is ambiguity

getCount

public int getCount()
Number of catalogue names, including synonyms

Returns:
the number of catalogue names

toString

public java.lang.String toString()

toRE

public java.lang.String toRE()
Retourne la liste des expressions regulieres pour chaque catalogue

Returns:
a string containing all the regular expression for one catalogue

getCatalogTable

public static CatalogTable getCatalogTable()
Static method for accessing the catalogTable object

Returns:
the catalogTable object

writeTable

public void writeTable(java.lang.String filename)
Write the catalogue description file

Parameters:
filename - filename for writing the table