cds.astro
Class Otype

java.lang.Object
  extended by cds.astro.Otype
All Implemented Interfaces:
java.io.Serializable

public class Otype
extends java.lang.Object
implements java.io.Serializable

The Otype is a classification of the astronomical objects in a hierarchical structure.

Version:
1.0 16-sep-2002
1.1 29-oct-2002 (Sylvaine Jaehn (Stage UTBM)) : ajout de la methode numericToHexa()
1.2 14-nov-2002 (SJ): ajout du test : if (!initialized) init(); ds constructeur otype sans parametre
ajout de la methode hexaToNumeric(String strHex)
1.3 24-jan-2003 (SJ) : methode init() mise public
, 1.4 jan 2004 (BB) : ajout de la methode equals. -------------
Author:
Francois Ochsenbein, Benoit Baranne (Stagiaire UTBM)
See Also:
Serialized Form

Field Summary
 int otype
           
 
Constructor Summary
Otype()
          Define the default Otype (object of unknown nature)
Otype(java.lang.String text)
          Define the Otype from a String
 
Method Summary
 boolean agrees(Otype ot1)
          Check if the 2 Otypes are compatible
 void dump()
          Dump contents to stdout
 boolean equals(java.lang.Object o)
          MOD-BB 21-01-04 Ajout de cette methode.
static java.lang.String hexaToNumeric(java.lang.String strHex)
          Methode qui transforme une chaine de caractere hexadecimale en otype sous forme numerique
 boolean implies(Otype t1)
          Check if is a subtype (in same branch)
static void init()
          Initialisation
static void init(java.lang.String filename)
          Initialisation
 java.util.Enumeration list()
          List in an enumeration all Otypes belonging to a class.
 Otype merge(Otype ot1)
          Choose the most accurate Otype: the deepest one ine the hierarchy.
 java.lang.String numericToHexa()
          Methode qui permet de transformer un otype decimal en hexadecimal
 void set(java.lang.String text)
          Convert a text into an object type
 java.lang.String toString()
          Default Edition of the Otype value
 java.lang.String toString(int choice)
          Default Edition of the Otype value
 void truncate(int lev)
          Truncate the otype to some upper level (e.g.
 
Methods inherited from class java.lang.Object
getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

otype

public int otype
Constructor Detail

Otype

public Otype()
Define the default Otype (object of unknown nature)


Otype

public Otype(java.lang.String text)
      throws java.text.ParseException
Define the Otype from a String

Parameters:
text - the Otype as a string
Throws:
java.text.ParseException - when otype is not understandable
Method Detail

init

public static void init()
Initialisation


init

public static void init(java.lang.String filename)
                 throws java.lang.Exception
Initialisation

Parameters:
filename - name of file with the list of Object Types
Throws:
java.lang.Exception - e.g. IOException if file not existing, parsing...

truncate

public final void truncate(int lev)
Truncate the otype to some upper level (e.g. Algol --> V*)

Parameters:
lev - the level (between 1 and 4)

implies

public final boolean implies(Otype t1)
Check if is a subtype (in same branch)

Parameters:
t1 - the other Otype
Returns:
true t1 is an upper class

agrees

public final boolean agrees(Otype ot1)
Check if the 2 Otypes are compatible

Parameters:
ot1 - the other Otype
Returns:
true t1 is compatible

merge

public final Otype merge(Otype ot1)
Choose the most accurate Otype: the deepest one ine the hierarchy.

Parameters:
ot1 - a second otype
Returns:
the 'most accurate' otype

set

public final void set(java.lang.String text)
               throws java.text.ParseException
Convert a text into an object type

Parameters:
text - the text representing the otype, either in numeric, or as one of the available abbreviations
Throws:
java.text.ParseException - when the text can' be interpreted.

list

public java.util.Enumeration list()
List in an enumeration all Otypes belonging to a class.

Returns:
An enumeration of Otypes in subtree

toString

public final java.lang.String toString(int choice)
Default Edition of the Otype value

Parameters:
choice - 0=numeric, 1=standard, 2=verbose, 3=3-letter
Returns:
the meaning of the Object Type

toString

public final java.lang.String toString()
Default Edition of the Otype value

Overrides:
toString in class java.lang.Object
Returns:
the "standard" explanation of hte object type

dump

public final void dump()
Dump contents to stdout


numericToHexa

public java.lang.String numericToHexa()
Methode qui permet de transformer un otype decimal en hexadecimal

Returns:
chaine representant la valeur de otype en hexadecimal

hexaToNumeric

public static java.lang.String hexaToNumeric(java.lang.String strHex)
Methode qui transforme une chaine de caractere hexadecimale en otype sous forme numerique

Parameters:
strHex - chaine representant un otype sous forme hexadecimale
Returns:
otype sous forme numerique

equals

public boolean equals(java.lang.Object o)
MOD-BB 21-01-04 Ajout de cette methode. Test d'egalite de Otype.

Overrides:
equals in class java.lang.Object
Parameters:
o - Objet a comparer.
Returns:
Vrai si o est identique a this, faux sinon.


Copyright © 2009 UDS/CNRS