cds.simbad
Class Magnitude

java.lang.Object
  extended bycds.util.Nodata
      extended bycds.simbad.BasicData
          extended bycds.simbad.Magnitude
All Implemented Interfaces:
java.io.Serializable

public class Magnitude
extends BasicData
implements java.io.Serializable

Magnitude object: contains a value and a filter definition. Peculiarities are stored in a MagnitudePec object. Several magnitudes for an object are stored in a MagnitudeList object, which can contain one (?) pecul. object. Filter specifications are contained in a MagnitudeFilter object

Version:
1.0 (MW)
, 1.1 21 nov 2002 (SJ) : Modification type mag et varampl
, 2.0 Sep 2003 (MW) : Magnitude includes a filter definition and is included in a MagnitudeList object, 2.1 Jan 2004 : Ajout de la methode equals.
Author:
Marc Wenger, Sylvaine Jaehn (Stage UTBM)
See Also:
Serialized Form

Field Summary
private  boolean homog
           
private static char HOMOGENEITY_FLAG
           
private  MagnitudeFilter magfilt
           
private  FloatPrec magfp
           
private static float MAXVAL
           
private static float MINVAL
           
private static Parameters pastro
           
private  MagnitudePecul pecul
           
 
Fields inherited from class cds.simbad.BasicData
dataExists
 
Fields inherited from class cds.util.Nodata
NODATA, NODATA_DBL, NODATA_FLT, NODATA_SHT, NODATA_STR
 
Constructor Summary
protected Magnitude()
          Constructor.This one is private: no magnitude should be defined without a MagnitudeFilter definition attached to it
  Magnitude(MagnitudeFilter magfilt)
          Constructor
  Magnitude(MagnitudeFilter magfilt, FloatPrec mag)
          Constructor initializing a magnitude with a FloatPrec value
  Magnitude(MagnitudeFilter magfilt, FloatPrec mag, boolean homog)
          Constructor initializing a magnitude with a FloatPrec value
  Magnitude(MagnitudeFilter magfilt, java.lang.String mag)
          Constructor initializing a magnitude with a string of format: '[+-9]9.999:'
 
Method Summary
 boolean equals(java.lang.Object o)
          MOD-BB 21-01-04 Ajout de cette methode.
 MagnitudeFilter getFilter()
          Returns the magnitude filter definition
 boolean getHomogeneity()
          Returns the homogeneity flag value (true or false)
 FloatPrec getMagnitude()
          Returns the magnitude value
 Magnitude set(FloatPrec mag)
          Sets a magnitude value
 Magnitude set(Magnitude magn)
          Sets a Magnitude object (copy)
 Magnitude set(java.lang.String magstr)
          Sets a magnitude value (and homogeneity flag)
 void set(java.lang.String magstr, boolean homog)
          Sets the magnitude value and homogeneity flag
 Magnitude setHomogeneity(boolean h)
          Sets the homogeneity flag
 Magnitude setMagnitude(java.lang.String magstr)
          Sets the magnitude value
 java.lang.String toString()
          Magnitude display function
 
Methods inherited from class cds.simbad.BasicData
exists, setExist, setNodata
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

HOMOGENEITY_FLAG

private static final char HOMOGENEITY_FLAG
See Also:
Constant Field Values

pastro

private static Parameters pastro

MINVAL

private static float MINVAL

MAXVAL

private static float MAXVAL

magfilt

private MagnitudeFilter magfilt

magfp

private FloatPrec magfp

homog

private boolean homog

pecul

private MagnitudePecul pecul
Constructor Detail

Magnitude

protected Magnitude()
Constructor.This one is private: no magnitude should be defined without a MagnitudeFilter definition attached to it


Magnitude

public Magnitude(MagnitudeFilter magfilt)
Constructor

Parameters:
magfilt - magnitude filter definition

Magnitude

public Magnitude(MagnitudeFilter magfilt,
                 java.lang.String mag)
          throws java.text.ParseException
Constructor initializing a magnitude with a string of format: '[+-9]9.999:'

Parameters:
magfilt - magnitude filter definition
mag - magnitude string
Throws:
java.text.ParseException - if the magnitude string cannot be parsed

Magnitude

public Magnitude(MagnitudeFilter magfilt,
                 FloatPrec mag)
Constructor initializing a magnitude with a FloatPrec value

Parameters:
magfilt - magnitude filter definition
mag - magnitude string

Magnitude

public Magnitude(MagnitudeFilter magfilt,
                 FloatPrec mag,
                 boolean homog)
Constructor initializing a magnitude with a FloatPrec value

Parameters:
magfilt - magnitude filter definition
mag - magnitude string
homog - true if homogeneity flag is set
Method Detail

set

public Magnitude set(Magnitude magn)
Sets a Magnitude object (copy)

Parameters:
magn - magnitude object to affect to this one
Returns:
the Magnitude object

set

public Magnitude set(java.lang.String magstr)
              throws java.text.ParseException
Sets a magnitude value (and homogeneity flag)

Parameters:
magstr - string containing the magnitude. Format: '[+-9]9.999:'. The string should have been trimmed before
Returns:
Magnitude object
Throws:
java.text.ParseException - if the string cannot be parsed

set

public Magnitude set(FloatPrec mag)
Sets a magnitude value

Parameters:
mag - magnitude value (includes precision)
Returns:
the Magnitude object

set

public void set(java.lang.String magstr,
                boolean homog)
         throws java.text.ParseException
Sets the magnitude value and homogeneity flag

Parameters:
magstr - magnitude in a string (the string should be trimmed)
homog - homogeneity flag
Throws:
java.text.ParseException - if the string cannot be parsed

setMagnitude

public Magnitude setMagnitude(java.lang.String magstr)
                       throws java.text.ParseException
Sets the magnitude value

Parameters:
magstr - magnitude in a string (the string should be trimmed)
Returns:
the magnitude object
Throws:
java.text.ParseException - if the string cannot be parsed

setHomogeneity

public Magnitude setHomogeneity(boolean h)
Sets the homogeneity flag

Parameters:
h - homogeneity flag
Returns:
the Magnitude object

getMagnitude

public FloatPrec getMagnitude()
Returns the magnitude value

Returns:
FloatPrec object. the magnitude value itself can be obtained by getMagnitude().getFloat()

getHomogeneity

public boolean getHomogeneity()
Returns the homogeneity flag value (true or false)

Returns:
true or false

getFilter

public MagnitudeFilter getFilter()
Returns the magnitude filter definition

Returns:
the MagnitudeFilter object

toString

public java.lang.String toString()
Magnitude display function

Returns:
the string containing the magnitude value and the homogeneity flag

equals

public boolean equals(java.lang.Object o)
MOD-BB 21-01-04 Ajout de cette methode. Comparaison de Magnitude.

Parameters:
o - Objet a comparer.
Returns:
Vrai si o est identique a this, faux sinon.