ucar.unidata.view.sounding
Class MeanWindCell

java.lang.Object
  extended by visad.ActionImpl
      extended by ucar.unidata.view.sounding.MeanWindCell
All Implemented Interfaces:
Runnable, EventListener, Action, ThingChangedListener

public class MeanWindCell
extends ActionImpl

Provides support for the computation of the density-weighted, mean horizontal wind.

Version:
$Id: MeanWindCell.java,v 1.14 2005/05/13 18:33:33 jeffmc Exp $
Author:
Steven R. Emmerson

Field Summary
static String MEAN_WIND
          The name of the mean wind property.
 
Fields inherited from class visad.ActionImpl
TRACE_STACK, TRACE_TIME
 
Constructor Summary
MeanWindCell()
          Constructs from nothing.
MeanWindCell(DataReference windProfileRef, DataReference densityProfileRef, DataReference meanWindRef)
          Constructs from DataReference-s to a wind profile, a density profile, and a mean wind.
MeanWindCell(Field windProfile, Field densityProfile)
          Constructs from a wind profile and a density profile.
 
Method Summary
 void addPropertyChangeListener(PropertyChangeListener listener)
          Adds a PropertyChangeListener.
 void addPropertyChangeListener(String name, PropertyChangeListener listener)
          Adds a PropertyChangeListener for a named property.
 void doAction()
          Compute a new mean-wind value.
 boolean equals(Object obj)
          Indicates if this instance is identical to another object.
 DataReference getMeanWindRef()
          Returns the data reference for the mean wind.
static Tuple getMissing()
          Returns the missing mean-wind value.
static TupleType getType()
          Returns the type of the mean wind.
 Tuple getWind()
          Returns the mean wind.
 int hashCode()
          Returns the hash code of this instance.
 void removePropertyChangeListener(PropertyChangeListener listener)
          Removes a PropertyChangeListener.
 void removePropertyChangeListener(String name, PropertyChangeListener listener)
          Removes a PropertyChangeListener for a named property.
 void setDensityProfile(Field densityProfile)
          Sets the air-density profile.
 void setWindProfile(Field windProfile)
          Sets the wind profile.
 
Methods inherited from class visad.ActionImpl
addReference, checkTicks, disableAction, enableAction, findReference, getCurrentActionThread, getLinks, getName, getTaskCount, printPool, removeAllReferences, removeReference, run, setEnabled, setName, setThreadPoolMaximum, stop, stopThreadPool, thingChanged, waitForTasks
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

MEAN_WIND

public static final String MEAN_WIND
The name of the mean wind property.

See Also:
Constant Field Values
Constructor Detail

MeanWindCell

public MeanWindCell()
             throws VisADException,
                    RemoteException
Constructs from nothing.

Throws:
VisADException - VisAD failure;
RemoteException - Java RMI failure.

MeanWindCell

public MeanWindCell(Field windProfile,
                    Field densityProfile)
             throws VisADException,
                    RemoteException
Constructs from a wind profile and a density profile.

Parameters:
windProfile - The wind profile.
densityProfile - The density profile.
Throws:
VisADException - VisAD failure;
RemoteException - Java RMI failure.

MeanWindCell

public MeanWindCell(DataReference windProfileRef,
                    DataReference densityProfileRef,
                    DataReference meanWindRef)
             throws VisADException,
                    RemoteException
Constructs from DataReference-s to a wind profile, a density profile, and a mean wind.

Parameters:
windProfileRef - The reference to the wind profile.
densityProfileRef - The reference to the density profile.
meanWindRef - The reference to the mean wind.
Throws:
VisADException - VisAD failure;
RemoteException - Java RMI failure.
Method Detail

getType

public static TupleType getType()
Returns the type of the mean wind.

Returns:
The type of the mean wind.

getMissing

public static Tuple getMissing()
Returns the missing mean-wind value.

Returns:
The missing mean-wind value.

doAction

public void doAction()
              throws VisADException,
                     RemoteException
Compute a new mean-wind value. This method will be invoked whenever the wind profile or density profile changes. This method will put the new value into the DataReference for the mean wind and will fire a PropertyChangeEvent for MEAN_WIND if the new value differs from the old.

Specified by:
doAction in class ActionImpl
Throws:
VisADException - VisAD failure.
RemoteException - Java RMI failure.

addPropertyChangeListener

public void addPropertyChangeListener(PropertyChangeListener listener)
Adds a PropertyChangeListener.

Parameters:
listener - The PropertyChangeListener to be added.

addPropertyChangeListener

public void addPropertyChangeListener(String name,
                                      PropertyChangeListener listener)
Adds a PropertyChangeListener for a named property.

Parameters:
name - The name of the property.
listener - The PropertyChangeListener to be added.

removePropertyChangeListener

public void removePropertyChangeListener(PropertyChangeListener listener)
Removes a PropertyChangeListener.

Parameters:
listener - The PropertyChangeListener to be removed.

removePropertyChangeListener

public void removePropertyChangeListener(String name,
                                         PropertyChangeListener listener)
Removes a PropertyChangeListener for a named property.

Parameters:
name - The name of the property.
listener - The PropertyChangeListener to be removed.

setWindProfile

public void setWindProfile(Field windProfile)
                    throws VisADException,
                           RemoteException
Sets the wind profile.

Parameters:
windProfile - The horizontal wind profile.
Throws:
VisADException - VisAD failure.
RemoteException - Java RMI failure.

setDensityProfile

public void setDensityProfile(Field densityProfile)
                       throws TypeException,
                              VisADException,
                              RemoteException
Sets the air-density profile.

Parameters:
densityProfile - The air-density profile.
Throws:
TypeException - Argument has wrong VisAD MathType.
VisADException - VisAD failure.
RemoteException - Java RMI failure.

getWind

public Tuple getWind()
              throws VisADException,
                     RemoteException
Returns the mean wind.

Returns:
The mean, horizontal wind.
Throws:
VisADException - VisAD failure.
RemoteException - Java RMI failure.

getMeanWindRef

public DataReference getMeanWindRef()
Returns the data reference for the mean wind.

Returns:
The data reference for the mean wind.

equals

public boolean equals(Object obj)
Indicates if this instance is identical to another object.

Overrides:
equals in class Object
Parameters:
obj - The other object.
Returns:
true if and only if this instance is identical to the other object.

hashCode

public int hashCode()
Returns the hash code of this instance.

Overrides:
hashCode in class Object
Returns:
The hash code of this instance.