cfa.vo.sed.dm
Class PosValue

java.lang.Object
  extended by cfa.vo.sed.dm.ArrayValue
      extended by cfa.vo.sed.dm.PosValue
All Implemented Interfaces:
IValue

public class PosValue
extends ArrayValue
implements IValue

PosValue is a convenience class that contains RA and DEC only, in its data Vector. It is essentially a child of ArrayValue with a size of 2. Callers should take care to add the value of RA first, then DEC. The class itself cannot distinguish between RA and DEC, so best practice calls for RA in index 0 and DEC in index 1. Behavior is undefined otherwise.


Field Summary
 
Fields inherited from class cfa.vo.sed.dm.ArrayValue
_isSet, _name, _type, _ucd, _units, _values
 
Constructor Summary
PosValue()
           
PosValue(java.lang.Object value, java.lang.String datatype)
           
PosValue(java.lang.Object value, java.lang.String ucd, java.lang.String name, java.lang.String units, java.lang.String type)
           
PosValue(java.lang.String ucd)
           
 
Method Summary
 void addDataValue(java.lang.Object value, java.lang.String datatype)
          Adds a value.
 java.lang.Object getDataValue(int index)
          Returns Double at requested index between 0 and 1.
 java.lang.Double getDec()
          Gets the dec.
 java.lang.String getPosString()
          Gets the the RA and DEC as a Position string= "RA DEC"
 java.lang.Double getRa()
          Gets the ra.
 void setDec(java.lang.Double dec)
          Sets the coverage dec.
 void setRa(java.lang.Double ra)
          Sets the ra.
 java.lang.String toString()
          Override Object's toString() method.
 
Methods inherited from class cfa.vo.sed.dm.ArrayValue
getData, getDatatype, getName, getSize, getUCD, getUnits, isConstant, isSet, setIsConstant, setName, setUCD, setUnits
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface cfa.vo.sed.dm.IValue
getData, getDatatype, getName, getSize, getUCD, getUnits, isConstant, isSet, setIsConstant, setName, setUCD, setUnits
 

Constructor Detail

PosValue

public PosValue()

PosValue

public PosValue(java.lang.String ucd)

PosValue

public PosValue(java.lang.Object value,
                java.lang.String datatype)

PosValue

public PosValue(java.lang.Object value,
                java.lang.String ucd,
                java.lang.String name,
                java.lang.String units,
                java.lang.String type)
Method Detail

getDataValue

public java.lang.Object getDataValue(int index)
                              throws SEDException
Returns Double at requested index between 0 and 1. Typically index 0 is RA and index 1 is Dec. Behavior is undefined if RA/DEC were added in wrong order. returns possible object is Object

Specified by:
getDataValue in interface IValue
Overrides:
getDataValue in class ArrayValue
Throws:
SEDException

addDataValue

public void addDataValue(java.lang.Object value,
                         java.lang.String datatype)
Adds a value. Care must be taken when adding RA/DEC that RA is added before Dec. To be sure, use setRa(), setDec() instead.

Specified by:
addDataValue in interface IValue
Overrides:
addDataValue in class ArrayValue
Parameters:
value - allowed object is Object

getPosString

public java.lang.String getPosString()
Gets the the RA and DEC as a Position string= "RA DEC"

Returns:
possible object is String

getRa

public java.lang.Double getRa()
Gets the ra. Equivalent to calling getDataValue(0), except no exceptions are thrown here.

Returns:
possible object is Double

setRa

public void setRa(java.lang.Double ra)
Sets the ra. Equivalent to calling addDataValue(Object ra) BEFORE dec is added.

Parameters:
ra - allowed object is Double

getDec

public java.lang.Double getDec()
Gets the dec. Equivalent to calling getDataValue(1), except no exceptions are thrown here.

Returns:
possible object is Double

setDec

public void setDec(java.lang.Double dec)
Sets the coverage dec. Equivalent to addDataValue(Object dec) AFTER ra has been added.

Parameters:
dec - allowed object is Double

toString

public java.lang.String toString()
Override Object's toString() method.

Overrides:
toString in class ArrayValue
Returns:
possible object is String