jsky.science
Class Wavelength

java.lang.Object
  extended by jsky.science.AbstractScienceObject
      extended by jsky.science.Quantity
          extended by jsky.science.Wavelength
All Implemented Interfaces:
java.beans.PropertyChangeListener, java.io.Serializable, java.lang.Cloneable, java.lang.Comparable, java.util.EventListener, ScienceObjectModel, ReplaceablePropertyChangeListener

public class Wavelength
extends Quantity

This class manages wavelengths and provides a means to easily track different units. Users can set a static default units and then retrieve a wavelength value (as double) by calling getValue().. or user can requests wavelengths in one of the following specific wavelengths: getValue( Wavelength.METER)

This code was developed by NASA, Goddard Space Flight Center, Code 587 for the Scientist's Expert Assistant (SEA) project for Next Generation Space Telescope (NGST).

Version:
6.1.00
Author:
Sandy Grosvenor
See Also:
Serialized Form

Nested Class Summary
 
Nested classes/interfaces inherited from class jsky.science.AbstractScienceObject
AbstractScienceObject.EventMonitor
 
Field Summary
static java.lang.String ANGSTROM
           
static java.lang.String ANGSTROMABBREV
           
static java.lang.String CENTIMETER
           
static java.lang.String CENTIMETERABBREV
           
static java.lang.String DEFAULTUNITS_PROPERTY
           
static int E_ANGSTROM
           
static int E_CENTIMETER
           
static int E_EV
           
static int E_GIGAHERTZ
           
static int E_HERTZ
           
static int E_KILOEV
           
static int E_KILOHERTZ
           
static int E_KILOMETER
           
static int E_MEGAEV
           
static int E_MEGAHERTZ
           
static int E_METER
          E_METER and other E_* variables are the exponents that represent the multiplier from meters to the specified E_
static int E_MICRON
           
static int E_MILLIMETER
           
static int E_NANOMETER
           
static java.lang.String EV
           
static java.lang.String EVABBREV
           
static java.lang.String GIGAHERTZ
           
static java.lang.String GIGAHERTZABBREV
           
static java.lang.String HERTZ
           
static java.lang.String HERTZABBREV
           
static java.lang.String KILOEV
           
static java.lang.String KILOEVABBREV
           
static java.lang.String KILOHERTZ
           
static java.lang.String KILOHERTZABBREV
           
static java.lang.String KILOMETER
           
static java.lang.String KILOMETERABBREV
           
static Wavelength MAX_VALUE
           
static java.lang.String MEGAEV
           
static java.lang.String MEGAEVABBREV
           
static java.lang.String MEGAHERTZ
           
static java.lang.String MEGAHERTZABBREV
           
static java.lang.String METER
           
static java.lang.String METERABBREV
           
static java.lang.String MICRON
           
static java.lang.String MICRONABBREV
           
static java.lang.String MILLIMETER
           
static java.lang.String MILLIMETERABBREV
           
static Wavelength MIN_VALUE
           
static java.lang.String NANOMETER
           
static java.lang.String NANOMETERABBREV
           
 
Fields inherited from class jsky.science.Quantity
fValue
 
Fields inherited from interface jsky.science.ScienceObjectModel
NAME_PROPERTY, PENDING_PROPERTY, VALID_PROPERTY
 
Constructor Summary
Wavelength()
           
Wavelength(double inValue)
          primary constructor
Wavelength(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)
          The workhorse of the Wavelength class.
 double getValue(java.lang.String unitsName)
          Returns value in specified Units.
 Quantity newInstance(double inValue)
          Returns a new Wavelength object with the specified value in the default units.
static void removeDefaultUnitsChangeListener(java.beans.PropertyChangeListener listener)
           
protected  void setValue(double inValue, java.lang.String unitsName)
          Sets the double value with the specified units.
 
Methods inherited from class jsky.science.Quantity
add, addDefaultUnitsChangeListener, equals, fireDefaultUnitsChange, fireDefaultUnitsChange, getAllUnits, getAllUnits, getAllUnitsAbbrev, getAllUnitsAbbrev, getDefaultUnits, getDefaultUnits, getDefaultUnitsAbbrev, getDefaultUnitsProperty, getUnitsAbbrev, getUnitsIgnoreCase, getValue, hashCode, initializeSubClass, isInitialized, removeDefaultUnitsChangeListener, setDefaultUnits, toString, toString
 
Methods inherited from class jsky.science.AbstractScienceObject
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
 
Methods inherited from class java.lang.Object
finalize, getClass, notify, notifyAll, wait, wait, wait
 

Field Detail

DEFAULTUNITS_PROPERTY

public static final java.lang.String DEFAULTUNITS_PROPERTY

E_METER

public static final int E_METER
E_METER and other E_* variables are the exponents that represent the multiplier from meters to the specified E_

See Also:
Constant Field Values

E_ANGSTROM

public static final int E_ANGSTROM
See Also:
Constant Field Values

E_NANOMETER

public static final int E_NANOMETER
See Also:
Constant Field Values

E_MICRON

public static final int E_MICRON
See Also:
Constant Field Values

E_MILLIMETER

public static final int E_MILLIMETER
See Also:
Constant Field Values

E_CENTIMETER

public static final int E_CENTIMETER
See Also:
Constant Field Values

E_KILOMETER

public static final int E_KILOMETER
See Also:
Constant Field Values

E_HERTZ

public static final int E_HERTZ
See Also:
Constant Field Values

E_KILOHERTZ

public static final int E_KILOHERTZ
See Also:
Constant Field Values

E_MEGAHERTZ

public static final int E_MEGAHERTZ
See Also:
Constant Field Values

E_GIGAHERTZ

public static final int E_GIGAHERTZ
See Also:
Constant Field Values

E_EV

public static final int E_EV
See Also:
Constant Field Values

E_KILOEV

public static final int E_KILOEV
See Also:
Constant Field Values

E_MEGAEV

public static final int E_MEGAEV
See Also:
Constant Field Values

ANGSTROM

public static final java.lang.String ANGSTROM

NANOMETER

public static final java.lang.String NANOMETER

MICRON

public static final java.lang.String MICRON

MILLIMETER

public static final java.lang.String MILLIMETER

CENTIMETER

public static final java.lang.String CENTIMETER

METER

public static final java.lang.String METER

KILOMETER

public static final java.lang.String KILOMETER

HERTZ

public static final java.lang.String HERTZ

KILOHERTZ

public static final java.lang.String KILOHERTZ

MEGAHERTZ

public static final java.lang.String MEGAHERTZ

GIGAHERTZ

public static final java.lang.String GIGAHERTZ

EV

public static final java.lang.String EV

KILOEV

public static final java.lang.String KILOEV

MEGAEV

public static final java.lang.String MEGAEV

ANGSTROMABBREV

public static final java.lang.String ANGSTROMABBREV

NANOMETERABBREV

public static final java.lang.String NANOMETERABBREV

MICRONABBREV

public static final java.lang.String MICRONABBREV

MILLIMETERABBREV

public static final java.lang.String MILLIMETERABBREV

CENTIMETERABBREV

public static final java.lang.String CENTIMETERABBREV

METERABBREV

public static final java.lang.String METERABBREV

KILOMETERABBREV

public static final java.lang.String KILOMETERABBREV

HERTZABBREV

public static final java.lang.String HERTZABBREV

KILOHERTZABBREV

public static final java.lang.String KILOHERTZABBREV

MEGAHERTZABBREV

public static final java.lang.String MEGAHERTZABBREV

GIGAHERTZABBREV

public static final java.lang.String GIGAHERTZABBREV

EVABBREV

public static final java.lang.String EVABBREV

KILOEVABBREV

public static final java.lang.String KILOEVABBREV

MEGAEVABBREV

public static final java.lang.String MEGAEVABBREV

MAX_VALUE

public static final Wavelength MAX_VALUE

MIN_VALUE

public static final Wavelength MIN_VALUE
Constructor Detail

Wavelength

public Wavelength()

Wavelength

public Wavelength(double inValue)
primary constructor

Parameters:
inValue - double of the actual Wavelength

Wavelength

public Wavelength(double inValue,
                  java.lang.String inUnits)
Primary constructor.

Parameters:
inValue - double of the actual Wavelength
inUnits - string containing the units in which the wavelength is given
Method Detail

newInstance

public Quantity newInstance(double inValue)
Returns a new Wavelength object with the specified value in the default units.

Specified by:
newInstance in class Quantity

getValue

public double getValue(java.lang.String unitsName)
Returns value in specified Units.

Specified by:
getValue in class Quantity

setValue

protected void setValue(double inValue,
                        java.lang.String unitsName)
Sets the double value with the specified units.

Specified by:
setValue in class Quantity

convert

public static double convert(double inVal,
                             java.lang.String fromUnits,
                             java.lang.String toUnits)
                      throws UnitsNotSupportedException
The workhorse of the Wavelength class. Converts a value between a source and a destination units

Throws:
UnitsNotSupportedException

addDefaultUnitsChangeListener

public static void addDefaultUnitsChangeListener(java.beans.PropertyChangeListener listener)

removeDefaultUnitsChangeListener

public static void removeDefaultUnitsChangeListener(java.beans.PropertyChangeListener listener)