|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectjsky.science.AbstractScienceObject
jsky.science.Quantity
jsky.science.Redshift
public class Redshift
Redshift manages redshift quantities and provides a means to easily track different units Users can set a static default units and then retrieve a redshift value (as double) by calling getLength(). On construction, the normal constructor is Redshift( value, units).
Currently units of Z and RADIALVELOCITY are supported. (Some additional units names such as PARSEC have been defined, but are not yet supported as valid units).
This code was developed by NASA, Goddard Space Flight Center, Code 588 for the Scientist's Expert Assistant (SEA) project for Next Generation Space Telescope (NGST).
Nested Class Summary |
---|
Nested classes/interfaces inherited from class jsky.science.AbstractScienceObject |
---|
AbstractScienceObject.EventMonitor |
Field Summary | |
---|---|
static java.lang.String |
ASTRONOMICALUNIT
|
static java.lang.String |
ASTRONOMICALUNITABBREV
|
static java.lang.String |
DEFAULTUNITS_PROPERTY
|
static java.lang.String |
DISTANCEMODULUS
|
static java.lang.String |
DISTANCEMODULUSABBREV
|
static java.lang.String |
PARSEC
|
static java.lang.String |
PARSECABBREV
|
static java.lang.String |
RADIALVELOCITY
|
static java.lang.String |
RADIALVELOCITYABBREV
|
static java.lang.String |
Z
|
static java.lang.String |
ZABBREV
|
Fields inherited from class jsky.science.Quantity |
---|
fValue |
Fields inherited from interface jsky.science.ScienceObjectModel |
---|
NAME_PROPERTY, PENDING_PROPERTY, VALID_PROPERTY |
Constructor Summary | |
---|---|
Redshift()
creates a default Redshift of length 0 with no name |
|
Redshift(double inValue)
creates a new Redshift of specified value in the default units |
|
Redshift(double inValue,
java.lang.String inUnits)
primary constructor |
Method Summary | |
---|---|
static void |
addDefaultUnitsChangeListener(java.beans.PropertyChangeListener listener)
|
static double |
convert(double inVal,
java.lang.String fromUnits,
java.lang.String toUnits)
This is the workhorse of the Redshift class - converts a value from one unit to the other. |
static java.lang.String |
getDefaultUnitsAbbrev()
|
double |
getValue(java.lang.String unitsName)
Returns a double containing current value in the specified units. |
static void |
main(java.lang.String[] args)
testing only |
Quantity |
newInstance(double inValue)
returns a new Redshift (as a Quantity) with value as specified in default units. |
static void |
removeDefaultUnitsChangeListener(java.beans.PropertyChangeListener listener)
|
protected void |
setValue(double inValue,
java.lang.String unitsName)
Sets the double value of a redshift with the specified units |
Methods inherited from class java.lang.Object |
---|
finalize, getClass, notify, notifyAll, wait, wait, wait |
Field Detail |
---|
public static final java.lang.String DEFAULTUNITS_PROPERTY
public static final java.lang.String Z
public static final java.lang.String RADIALVELOCITY
public static final java.lang.String PARSEC
public static final java.lang.String ASTRONOMICALUNIT
public static final java.lang.String DISTANCEMODULUS
public static final java.lang.String ZABBREV
public static final java.lang.String RADIALVELOCITYABBREV
public static final java.lang.String PARSECABBREV
public static final java.lang.String ASTRONOMICALUNITABBREV
public static final java.lang.String DISTANCEMODULUSABBREV
Constructor Detail |
---|
public Redshift()
public Redshift(double inValue)
public Redshift(double inValue, java.lang.String inUnits)
inValue
- double of the actual RedshiftinUnits
- string containing the units in which the value is givenMethod Detail |
---|
public static void main(java.lang.String[] args)
public Quantity newInstance(double inValue)
newInstance
in class Quantity
public double getValue(java.lang.String unitsName)
double
containing current value in the specified units.
getValue
in class Quantity
protected void setValue(double inValue, java.lang.String unitsName)
setValue
in class Quantity
public static double convert(double inVal, java.lang.String fromUnits, java.lang.String toUnits) throws UnitsNotSupportedException
UnitsNotSupportedException
public static void addDefaultUnitsChangeListener(java.beans.PropertyChangeListener listener)
public static void removeDefaultUnitsChangeListener(java.beans.PropertyChangeListener listener)
public static java.lang.String getDefaultUnitsAbbrev()
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |