cds.simbad
Class ErrorData

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

public class ErrorData
extends BasicData

Class defining a error value associated with a data. It can be either a simple error value, either an ellipse defined as [maj_axis min_axis angle]

Version:
1.0 30 oct 2002 creation,
1.1 Sep 2003 MW: constructor with a string: accepts both cases
Author:
Sylvaine Jaehn (Stage UTBM), Marc Wenger/CDS
See Also:
Serialized Form

Field Summary
private  short angle
          Angle
private  boolean isEllipse
          specifies if it is an ellipse or not
private  FloatPrec majorAxis
          major axis
private  FloatPrec minorAxis
          minor axis
 
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
ErrorData()
          Constructor without parameters
ErrorData(ErrorData error)
          Copy constructor
ErrorData(FloatPrec error)
          Constructor specifying a simple error
ErrorData(FloatPrec majorAxis, FloatPrec minorAxis, short angle)
          Constructor specifying the ellipse parameters
ErrorData(java.lang.String error)
          Constructor with a string
ErrorData(java.lang.String majorAxis, java.lang.String minorAxis, short angle)
          Constructor specifying the ellipse parameters
 
Method Summary
 java.lang.String angleToString()
          Gets the angle
 short getAngle()
          Gets the angle
 FloatPrec getMajorAxis()
          Gets the major axis
 FloatPrec getMinorAxis()
          Gets the minor axis
private  void init(FloatPrec error)
          Initialize an error data object
private  void init(FloatPrec majorAxis, FloatPrec minorAxis, short angle)
          Initialize an error data object
private  void init(java.lang.String error)
          Initialize an simple error data object
private  void init(java.lang.String majorAxis, java.lang.String minorAxis, short angle)
          Initialize an error data object
 boolean isEllipse()
          Says if the error is a simple value or an ellipse
 java.lang.String majAxisToString()
          Gets the major axis a String
 java.lang.String minAxisToString()
          Gets the minor axis a String
 void set(ErrorData error)
          Sets an error object in this one
 void setAngle(short angle)
          Sets the angle of the error elipse
 void setAngle(java.lang.String angle)
          Sets the angle of the error elipse
 void setMajorAxis(java.lang.String majorAxis)
          Sets the major axis
 void setMinorAxis(java.lang.String minorAxis)
          Sets the minor axis
 java.lang.String toString()
          Display the error.
 
Methods inherited from class cds.simbad.BasicData
exists, setExist, setNodata
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

majorAxis

private FloatPrec majorAxis
major axis


minorAxis

private FloatPrec minorAxis
minor axis


angle

private short angle
Angle


isEllipse

private boolean isEllipse
specifies if it is an ellipse or not

Constructor Detail

ErrorData

public ErrorData()
Constructor without parameters


ErrorData

public ErrorData(java.lang.String error)
Constructor with a string

Parameters:
error - it can be a simple error or an ellipse between [ ]

ErrorData

public ErrorData(java.lang.String majorAxis,
                 java.lang.String minorAxis,
                 short angle)
Constructor specifying the ellipse parameters

Parameters:
majorAxis - major axis of the error ellipse
minorAxis - minor axis of the ellipse
angle - angle

ErrorData

public ErrorData(FloatPrec majorAxis,
                 FloatPrec minorAxis,
                 short angle)
Constructor specifying the ellipse parameters

Parameters:
majorAxis - major axis of the error ellipse
minorAxis - minor axis of the ellipse
angle - angle

ErrorData

public ErrorData(FloatPrec error)
Constructor specifying a simple error

Parameters:
error - single error value

ErrorData

public ErrorData(ErrorData error)
Copy constructor

Parameters:
error - ErrorData object to copy in the created ErrorData object
Method Detail

init

private final void init(java.lang.String error)
Initialize an simple error data object

Parameters:
error - single error value

init

private final void init(java.lang.String majorAxis,
                        java.lang.String minorAxis,
                        short angle)
Initialize an error data object

Parameters:
majorAxis - grand axe
minorAxis - petit axe
angle - angle

init

private final void init(FloatPrec error)
Initialize an error data object

Parameters:
error - single error value

init

private final void init(FloatPrec majorAxis,
                        FloatPrec minorAxis,
                        short angle)
Initialize an error data object

Parameters:
majorAxis - grand axe
minorAxis - petit axe
angle - angle

set

public void set(ErrorData error)
Sets an error object in this one

Parameters:
error - error object to affect to this one

setMajorAxis

public void setMajorAxis(java.lang.String majorAxis)
Sets the major axis

Parameters:
majorAxis - major axis of the error ellipse

setMinorAxis

public void setMinorAxis(java.lang.String minorAxis)
Sets the minor axis

Parameters:
minorAxis - minor axis of the error ellipse

setAngle

public void setAngle(java.lang.String angle)
Sets the angle of the error elipse

Parameters:
angle - angle as a string

setAngle

public void setAngle(short angle)
Sets the angle of the error elipse

Parameters:
angle - angle as a short

getMajorAxis

public FloatPrec getMajorAxis()
Gets the major axis

Returns:
major axis as a FloatPrec object

majAxisToString

public java.lang.String majAxisToString()
Gets the major axis a String

Returns:
the major axis edited in a string, with respect of NODATA or precision

getMinorAxis

public FloatPrec getMinorAxis()
Gets the minor axis

Returns:
minor axis as a FloatPrec object

minAxisToString

public java.lang.String minAxisToString()
Gets the minor axis a String

Returns:
the minor axis edited in a string, with respect of NODATA or precision

getAngle

public short getAngle()
Gets the angle

Returns:
the angle as a short integer

angleToString

public java.lang.String angleToString()
Gets the angle

Returns:
the angle as a short integer

isEllipse

public boolean isEllipse()
Says if the error is a simple value or an ellipse

Returns:
true id it is an ellipse, false otherwise

toString

public java.lang.String toString()
Display the error. All errors are displayed between square brackets

Returns:
the edited error in a String