Package ucar.unidata.view.sounding
Class ComputeCell
java.lang.Object
ucar.unidata.view.sounding.ComputeCell
- Direct Known Subclasses:
AddCell
,AirDensityProfileCell
,AirTemperatureCell
,BuoyancyProfileCell
,DewPointExtractorCell
,DomainEvaluatorCell
,DomainExtractorCell
,DryTrajectoryCell
,EnergyFeatureCell
,EnergyProfileCell
,EvaluateIntegralCell
,IntegrateCell
,LayerMeanCell
,LclPressureCell
,LclTemperatureCell
,MaxPressureCell
,MixingRatioCell
,MixingRatioProfileCell
,PotentialTemperatureProfileCell
,ProfileCleanerCell
,ProfileCombinerCell
,ProfileFeatureCell
,RealEvaluatorCell
,SelectorCell
,TuplerCell
,VirtualTemperatureProfileCell
,WetTrajectoryCell
Abstract, computational entity with one or more inputs and one output.
- Version:
- $Revision: 1.9 $ $Date: 2005/08/02 17:01:09 $
- Author:
- Steven R. Emmerson
-
Constructor Summary
ConstructorsModifierConstructorDescriptionprotected
ComputeCell
(String name, DataReference[] inRefs, Data initValue) Constructs from a name for the instance and the input and output data references. -
Method Summary
Modifier and TypeMethodDescriptionfinal void
clean()
Cleans this instance.protected abstract Data
Computes the output data objects.final boolean
disableRef
(DataReference ref) Disables an input data reference.final void
Enables all input data references.final DataReference[]
Returns the input data references.final DataReference
Returns the data references to the output data objects.protected static FlatField
noDataField
(RealType rangeType) Convenience method for creating an empty atmospheric profile of a given parameter.final String
toString()
Returns a string representation of this instance.
-
Constructor Details
-
ComputeCell
protected ComputeCell(String name, DataReference[] inRefs, Data initValue) throws RemoteVisADException, VisADException, RemoteException Constructs from a name for the instance and the input and output data references. The name of theActionImpl
will be the name of this instance with the suffix ".action". The input and output data references arrays are cloned. Subclasses should invokeenableAllInputRefs()
at the end of their construction to start theDataReference
s-listening thread.- Parameters:
name
- The name for the instance.inRefs
- The inputDataReference
s.initValue
- The initial value of the output data.- Throws:
RemoteVisADException
- ifinitValue
is aRemoteData
.NullPointerException
- if any argument isnull
or if an input data reference isnull
.VisADException
- if a VisAD failure occurs.RemoteException
- if a Java RMI failure occurs.
-
-
Method Details
-
getInputRefs
Returns the input data references. The returned array is not backed by this instance.- Returns:
- The input data references.
-
getOutputRef
Returns the data references to the output data objects. The array is not backed by this instance.- Returns:
- The references to the output data objects.
-
enableAllInputRefs
Enables all input data references. An enabled input data reference will trigger recomputation of the output data object when the referenced, input data object changes.- Throws:
NullPointerException
- if an input data reference isnull
.VisADException
- if a VisAD failure occurs.RemoteException
- if a Java RMI failure occurs.
-
disableRef
Disables an input data reference. A disabled input data reference will not trigger recomputation of the output data object when the referenced, input data object changes.- Parameters:
ref
- The input data reference to disable.- Returns:
- True if and only if the input data reference was enabled when this method was invoked.
- Throws:
NullPointerException
- if the argument isnull
.VisADException
- if a VisAD failure occurs.RemoteException
- if a Java RMI failure occurs.
-
compute
protected abstract Data compute(Data[] datums) throws TypeException, VisADException, RemoteException Computes the output data objects. This method is invoked by this instance'sActionImpl
. It is the subclass's responsibility of to set the output data references.- Parameters:
datums
- The input data in the same order as during construction (i.e.datums[i]
corresponds toinRefs[i]
.- Returns:
- The output data objec corresponding to the input data.
- Throws:
ClassCastException
- if an input data reference has the wrong type of VisAD data object (e.g. aReal
instead of aField
).TypeException
- if the internal details of a VisAD data object are wrong (e.g. incompatible unit).VisADException
- if a VisAD failure occurs.RemoteException
- if a Java RMI failure occurs.
-
clean
Cleans this instance. All data references are removed from this instance'sActionImpl
and the action is stopped. This instance may be reused after invoking this method,- Throws:
VisADException
- if a VisAD failure occurs.RemoteException
- if a Java RMI failure occurs.
-
toString
Returns a string representation of this instance. The instance's name is returned. -
noDataField
Convenience method for creating an empty atmospheric profile of a given parameter.- Parameters:
rangeType
- The type of parameter.- Returns:
- An empty profile with the parameter as its range type.
- Throws:
VisADException
- if a VisAD failure occurs.RemoteException
- if a Java RMI failure occurs.
-