cds.astro
Class Sptype

java.lang.Object
  extended by cds.astro.Sptype
All Implemented Interfaces:
java.io.Serializable, java.lang.Cloneable

public class Sptype
extends java.lang.Object
implements java.io.Serializable, java.lang.Cloneable

Spectral type

See Also:
Serialized Form

Field Summary
static int _CN
           
static int _comp
           
static int _em
           
static int _HOUK
           
static long _INCOMPLETE
           
static int _m
           
static int _MK
           
static int _n
           
static int _neb
           
static int _nn
           
static int _NONE
           
static long _NOSUBTYPE
           
static int _pec
           
static int _s
           
static int _sh
           
static long _UNCERTAINTY
           
static int _var
           
static int _W
           
static int _WD_DA10
           
static int _WD_H_FLAG
           
static int _WD_P_FLAG
           
static int _WD_WD_FLAG
           
static int _WD_X_FLAG
           
static char EOS
           
static int NOSUBTYPE_VALUE
           
protected static int[] roundSubsubtype1
           
protected static int[] roundSubsubtype2
           
protected static int[] roundSubsubtype4
           
protected static int[] tempCodes
           
protected static java.lang.String tempLetters
           
static int UNKNOWN_CODE
           
 
Constructor Summary
Sptype()
          Empty constructor
Sptype(Sptype sp)
          Copy constructor.
Sptype(java.lang.String sp)
          Constructor with initialisation by a spectral type string
 
Method Summary
 java.lang.Object clone()
          Copy values parameters
 boolean equals(java.lang.Object o)
          Spectral type object comparison
 java.lang.String get()
          Get the spectral type string
 long getSpBin()
          Get the binary spectral type value
 long getSpMask()
          Get the spectral type binary mask (used for sql queries)
 boolean hasValue()
          Checks wether the SpectralType has a value
 int parse(java.lang.String sp)
          Parse a spectral type string
 int parse(java.lang.String sp, int offset)
          Parse a spectral type string
 void reset()
          Resets a SpectralType object to nodata
 void set(Sptype sp)
          Sets the SpectralType from another SpectralType object
 void set(java.lang.String sp)
          Sets a spectral type value to this object
 java.lang.String toString()
          returns the spectral type string
 
Methods inherited from class java.lang.Object
finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

UNKNOWN_CODE

public static final int UNKNOWN_CODE
See Also:
Constant Field Values

_UNCERTAINTY

public static final long _UNCERTAINTY
See Also:
Constant Field Values

_NOSUBTYPE

public static final long _NOSUBTYPE
See Also:
Constant Field Values

_INCOMPLETE

public static final long _INCOMPLETE
See Also:
Constant Field Values

EOS

public static final char EOS
See Also:
Constant Field Values

_CN

public static final int _CN
See Also:
Constant Field Values

_W

public static final int _W
See Also:
Constant Field Values

_m

public static final int _m
See Also:
Constant Field Values

_s

public static final int _s
See Also:
Constant Field Values

_n

public static final int _n
See Also:
Constant Field Values

_nn

public static final int _nn
See Also:
Constant Field Values

_sh

public static final int _sh
See Also:
Constant Field Values

_neb

public static final int _neb
See Also:
Constant Field Values

_var

public static final int _var
See Also:
Constant Field Values

_em

public static final int _em
See Also:
Constant Field Values

_comp

public static final int _comp
See Also:
Constant Field Values

_pec

public static final int _pec
See Also:
Constant Field Values

NOSUBTYPE_VALUE

public static final int NOSUBTYPE_VALUE
See Also:
Constant Field Values

_HOUK

public static final int _HOUK
See Also:
Constant Field Values

_MK

public static final int _MK
See Also:
Constant Field Values

_NONE

public static final int _NONE
See Also:
Constant Field Values

_WD_WD_FLAG

public static final int _WD_WD_FLAG
See Also:
Constant Field Values

_WD_X_FLAG

public static final int _WD_X_FLAG
See Also:
Constant Field Values

_WD_H_FLAG

public static final int _WD_H_FLAG
See Also:
Constant Field Values

_WD_P_FLAG

public static final int _WD_P_FLAG
See Also:
Constant Field Values

_WD_DA10

public static final int _WD_DA10
See Also:
Constant Field Values

tempLetters

protected static final java.lang.String tempLetters
See Also:
Constant Field Values

roundSubsubtype4

protected static final int[] roundSubsubtype4

roundSubsubtype2

protected static final int[] roundSubsubtype2

roundSubsubtype1

protected static final int[] roundSubsubtype1

tempCodes

protected static int[] tempCodes
Constructor Detail

Sptype

public Sptype()
Empty constructor


Sptype

public Sptype(java.lang.String sp)
       throws java.text.ParseException
Constructor with initialisation by a spectral type string

Parameters:
sp - spectral type string. Currently no validity check is made on the string
Throws:
java.text.ParseException - if the spectral type is incorrect

Sptype

public Sptype(Sptype sp)
Copy constructor.

Parameters:
sp - SpectralType object
Method Detail

reset

public void reset()
Resets a SpectralType object to nodata


hasValue

public boolean hasValue()
Checks wether the SpectralType has a value

Returns:
true if it has a value, false otherwise

set

public void set(java.lang.String sp)
         throws java.text.ParseException
Sets a spectral type value to this object

Parameters:
sp - spectral type string. Currently no validity check is made on the string
Throws:
java.text.ParseException - if the spectral type is incorrect

set

public void set(Sptype sp)
Sets the SpectralType from another SpectralType object

Parameters:
sp - SpectralType object to copy

get

public java.lang.String get()
Get the spectral type string

Returns:
the spectral type string

getSpBin

public long getSpBin()
Get the binary spectral type value

Returns:
the long containing the binary spectral type

getSpMask

public long getSpMask()
Get the spectral type binary mask (used for sql queries)

Returns:
the bit mask

toString

public java.lang.String toString()
returns the spectral type string

Overrides:
toString in class java.lang.Object
Returns:
the spectral type string

equals

public boolean equals(java.lang.Object o)
Spectral type object comparison

Overrides:
equals in class java.lang.Object
Parameters:
o - Object to compare
Returns:
True if the two objects are equals, false otherwise

parse

public int parse(java.lang.String sp)
          throws java.text.ParseException
Parse a spectral type string

Parameters:
sp - spectral type string
Returns:
the first char not used in parsing
Throws:
java.text.ParseException

parse

public int parse(java.lang.String sp,
                 int offset)
          throws java.text.ParseException
Parse a spectral type string

Parameters:
sp - spectral type string
offset - first char to use in parsing
Returns:
the first char not used for the parsing
Throws:
java.text.ParseException

clone

public java.lang.Object clone()
Copy values parameters

Overrides:
clone in class java.lang.Object
Returns:
a copy of the object