cds.simbad
Class MeasurementDescription

java.lang.Object
  extended bycds.simbad.MeasurementDescription

public class MeasurementDescription
extends java.lang.Object

An object of this class contains all information needed to manage a measurement type. These objects are created from the Parameters file describing the measurements

The measurements are defined in a Parameters file.
A [Measurements] section contains general definitions, and each measurement catalogue is defined in its own section called [mes CATNAME]. Every such section contains again some general definitions, and the list of the fields (columns) from this catalogue :

 [mes CATNAME]
 acronym=CAT
 name=full name of the catalogue
 description=description of the catalogue
 header=header to use for displaying the catalogue
 format=output format
 fieldN=description of each field to be treated as one column in the catalogue
 
This description consist of the following information:
 first_col-last_col,field_name,field_descr,ucd,unit,datatype,precision,width,arraysize
 
The separator is free: it will be the first non decimal digit after the field value. Two characters are forbidden as separator: any kind of space and '-'.

ommited values must be taken in account in the number of separators, but all values absent from the end of a definition can be ommited with their separators.

Comments are written on lines beginning with a '#'. Empty lines are allowed. Example:

 [mes MK]
 #               1         2         3         4         5         6
 #     01234567890123456789012345678901234567890123456789012345678901234
 # MK  |ds/mss Spectral type                       |     reference     |
 # ---------------------------------------------------------------------
 # MK m|  /    G2Ibvar                             |1954ApJS....1..175B|
 name=MK
 description=MK classifications in the Morgan-Keenan system and \
             the Michigan Catalogues of Two-Dimensional Spectral Types for \
             the HD stars (Houk N., 1975, and seq.).
 field1 = 1-3,ds,dispersive system,UCD,,A,,2,*
 field2 = 4-7,mss,mss notes,UCD,,A,,3,*
 field3 = 8-44,Spectral type,MK/MSS spectral type,UCD,,A,36,*
 field4 = 45-64,Reference,Reference,REFER_BIBCODE,,A,19,*
 

Version:
1.0 May 2002
Author:
Marc Wenger/CDS

Field Summary
private  java.lang.String acronym
           
private  java.lang.String format
           
private  java.lang.String header
           
private static java.util.Hashtable mdlist
           
private  VotTable measTable
           
private  MFormat mformat
           
 
Constructor Summary
MeasurementDescription()
           
 
Method Summary
static int buildFrom(Parameters pmes)
          Creates all the objects from the Parameters object.
static MeasurementDescription get(java.lang.String acronym)
          Gets a MeasurementDescription Object for the given catalogue name
 java.lang.String getAcronym()
          gets the acronym
static VotMeasurementField getField(java.lang.String acronym, int fieldNumber)
          Gets a VotField field object, defined by its rank number, for a given catalogue
static VotMeasurementField getField(java.lang.String acronym, java.lang.String fieldname)
          Gets a VotField field object, defined by its name, for a given catalogue
 java.lang.String getHeader()
          gets the header string
 VotTable getMeasTable()
          Gets the measurement table description
static VotTable getMeasTable(java.lang.String acronym)
          Gets the measurement table description corresponding to a catalogue
 MFormat getMFormat()
          gets the compiled format
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

mdlist

private static java.util.Hashtable mdlist

acronym

private java.lang.String acronym

header

private java.lang.String header

format

private java.lang.String format

mformat

private MFormat mformat

measTable

private VotTable measTable
Constructor Detail

MeasurementDescription

public MeasurementDescription()
Method Detail

buildFrom

public static int buildFrom(Parameters pmes)
Creates all the objects from the Parameters object. The created objects are stored in a static hashtable. The method get(cataloguename) will allow their retrieval.

Parameters:
pmes - Parameters object containing the measurement descriptions
Returns:
the number of objects created

getAcronym

public java.lang.String getAcronym()
gets the acronym

Returns:
The acronym for measurement type managed by this object

getHeader

public java.lang.String getHeader()
gets the header string

Returns:
The header string

getMFormat

public MFormat getMFormat()
gets the compiled format

Returns:
the compiled format needed to format a measurement
See Also:
cds.simbad.CFormat

getMeasTable

public VotTable getMeasTable()
Gets the measurement table description

Returns:
The measurement VotTable description

getMeasTable

public static VotTable getMeasTable(java.lang.String acronym)
Gets the measurement table description corresponding to a catalogue

Parameters:
acronym - catalogue acronym
Returns:
the VotTable object for this catalogue

getField

public static VotMeasurementField getField(java.lang.String acronym,
                                           java.lang.String fieldname)
Gets a VotField field object, defined by its name, for a given catalogue

Parameters:
acronym - catalogue acronym
fieldname - name of the field
Returns:
the VotMeasurementField, or null

getField

public static VotMeasurementField getField(java.lang.String acronym,
                                           int fieldNumber)
Gets a VotField field object, defined by its rank number, for a given catalogue

Parameters:
acronym - catalogue acronym
fieldNumber - rank number of the field
Returns:
the VotMeasurementField, or null

get

public static MeasurementDescription get(java.lang.String acronym)
Gets a MeasurementDescription Object for the given catalogue name

Parameters:
acronym - Measurement acronym for which the description should be found
Returns:
the MeasurementDescription object corresponding to the catalogue