public class Redshift extends Quantity
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).
AbstractScienceObject.EventMonitor
Modifier and Type | Field and Description |
---|---|
static String |
ASTRONOMICALUNIT |
static String |
ASTRONOMICALUNITABBREV |
static String |
DEFAULTUNITS_PROPERTY |
static String |
DISTANCEMODULUS |
static String |
DISTANCEMODULUSABBREV |
static String |
PARSEC |
static String |
PARSECABBREV |
static String |
RADIALVELOCITY |
static String |
RADIALVELOCITYABBREV |
static String |
Z |
static String |
ZABBREV |
NAME_PROPERTY, PENDING_PROPERTY, VALID_PROPERTY
Constructor and Description |
---|
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,
String inUnits)
primary constructor
|
Modifier and Type | Method and Description |
---|---|
static void |
addDefaultUnitsChangeListener(PropertyChangeListener listener) |
static double |
convert(double inVal,
String fromUnits,
String toUnits)
This is the workhorse of the Redshift class - converts a value
from one unit to the other.
|
static String |
getDefaultUnitsAbbrev() |
double |
getValue(String unitsName)
Returns a
double containing current value in the specified units. |
static void |
main(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(PropertyChangeListener listener) |
protected void |
setValue(double inValue,
String unitsName)
Sets the double value of a redshift with the specified units
|
add, addDefaultUnitsChangeListener, equals, fireDefaultUnitsChange, fireDefaultUnitsChange, getAllUnits, getAllUnits, getAllUnitsAbbrev, getAllUnitsAbbrev, getDefaultUnits, getDefaultUnits, getDefaultUnitsAbbrev, getDefaultUnitsProperty, getUnitsAbbrev, getUnitsIgnoreCase, getValue, hashCode, initializeSubClass, isInitialized, removeDefaultUnitsChangeListener, setDefaultUnits, toString, toString
addEventMonitor, addPropertyChangeListener, areNamesEqual, clearAllListeners, clone, compareTo, createDefaultName, firePropertyChange, firePropertyChange, fireReplaceObject, fireReplaceObject, fireReplaceObject, fireVetoableChange, fireVetoableChange, getException, getLabel, getName, getObjectIdString, getObjectIdString, getParent, isHolding, isPending, isTracing, isValid, notifyEventMonitors, propertyChange, removeEventMonitor, removePropertyChangeListener, replaceObject, replaceObjectNYI, setException, setHolding, setName, setParent, setTraceAll, setTracing, writeDebug, writeError
public static final String DEFAULTUNITS_PROPERTY
public static final String Z
public static final String RADIALVELOCITY
public static final String PARSEC
public static final String ASTRONOMICALUNIT
public static final String DISTANCEMODULUS
public static final String ZABBREV
public static final String RADIALVELOCITYABBREV
public static final String PARSECABBREV
public static final String ASTRONOMICALUNITABBREV
public static final String DISTANCEMODULUSABBREV
public Redshift()
public Redshift(double inValue)
public Redshift(double inValue, String inUnits)
inValue
- double of the actual RedshiftinUnits
- string containing the units in which the value is givenpublic static void main(String[] args)
public Quantity newInstance(double inValue)
newInstance
in class Quantity
public double getValue(String unitsName)
double
containing current value in the specified units.protected void setValue(double inValue, String unitsName)
public static double convert(double inVal, String fromUnits, String toUnits) throws UnitsNotSupportedException
UnitsNotSupportedException
public static void addDefaultUnitsChangeListener(PropertyChangeListener listener)
public static void removeDefaultUnitsChangeListener(PropertyChangeListener listener)
public static String getDefaultUnitsAbbrev()
Copyright © 2023 Central Laboratory of the Research Councils. All Rights Reserved.