public abstract class Quantity
extends java.lang.Object
Modifier and Type | Field and Description |
---|---|
ucar.visad.Quantity.DependenceMode |
DEPENDENT
Indicates that a secondary object will be the same object as the primary
object.
|
ucar.visad.Quantity.DependenceMode |
INDEPENDENT
Indicates that a secondary object will be a different object than
the primary object.
|
ucar.visad.Quantity.DependenceMode |
UNIMPORTANT
Indicates that it is irrelevant whether or not a secondary object will be
a different object than the primary object.
|
Modifier and Type | Method and Description |
---|---|
visad.MathType |
getMathType()
Returns the natural
MathType of this quantity. |
java.lang.String |
getName()
Returns the name of this quantity.
|
visad.RealTupleType |
getRealTupleType()
Returns the VisAD
RealTupleType of this quantity. |
boolean |
isCompatible(visad.Data data)
Indicates if a VisAD data object is compatible with this
instance.
|
boolean |
isCompatible(visad.MathType type)
Indicates if a VisAD MathType is compatible with this
instance.
|
visad.RealTuple |
newRealTuple(double[] amounts,
visad.Unit[] units)
Returns a single tuple of this quantity.
|
visad.RealTuple |
newRealTuple(double[] amounts,
visad.Unit[] units,
visad.CoordinateSystem coordSys)
Returns a single tuple of this quantity.
|
visad.RealTuple |
newRealTuple(double[] amounts,
visad.Unit[] units,
visad.ErrorEstimate[] errors,
visad.CoordinateSystem coordSys)
Returns a single tuple of this quantity.
|
visad.RealTuple |
newRealTuple(visad.Real[] values,
visad.CoordinateSystem coordSys)
Returns a single tuple of this quantity.
|
visad.DataImpl |
newValue(double[] amounts,
visad.Unit[] units,
visad.ErrorEstimate[] errors,
visad.CoordinateSystem coordSys)
Returns a single value of this quantity.
|
void |
vet(visad.Data data)
Vets a VisAD data object for compatibility.
|
void |
vet(visad.MathType type)
Vets a VisAD MathType for compatibility.
|
public final ucar.visad.Quantity.DependenceMode DEPENDENT
public final ucar.visad.Quantity.DependenceMode INDEPENDENT
public final ucar.visad.Quantity.DependenceMode UNIMPORTANT
public final java.lang.String getName()
public final visad.RealTupleType getRealTupleType()
RealTupleType
of this quantity.public visad.MathType getMathType()
MathType
of this quantity. This method
should be overridden in subclasses when appropriate.MathType
of this quantity.
The class of the object is either RealType
or RealTupleType
.public final visad.RealTuple newRealTuple(double[] amounts, visad.Unit[] units) throws visad.VisADException, java.rmi.RemoteException
null
.amounts
- The numeric values.units
- The units of the numeric values. May be
null
.visad.VisADException
- VisAD failure.java.rmi.RemoteException
- Java RMI failure.newRealTuple(double[], Unit[], CoordinateSystem)
public final visad.RealTuple newRealTuple(double[] amounts, visad.Unit[] units, visad.CoordinateSystem coordSys) throws visad.VisADException, java.rmi.RemoteException
null
.amounts
- The numeric values.units
- The units of the numeric values. May be
null
.coordSys
- The coordinate system transformation for this
particular tuple. Must be compatible with the
default coordinate system transformation. May
be null
.visad.VisADException
- VisAD failure.java.rmi.RemoteException
- Java RMI failure.newRealTuple(double[], Unit[], ErrorEstimate[], CoordinateSystem)
public visad.RealTuple newRealTuple(double[] amounts, visad.Unit[] units, visad.ErrorEstimate[] errors, visad.CoordinateSystem coordSys) throws visad.VisADException, java.rmi.RemoteException
amounts
- The numeric values.units
- The units of the numeric values. May be
null
.errors
- The error estimates. May be null
.coordSys
- The coordinate system transformation for this
particular tuple. Must be compatible with the
default coordinate system transformation. May
be null
.visad.VisADException
- VisAD failure.java.rmi.RemoteException
- Java RMI failure.newRealTuple(Real[], CoordinateSystem)
public visad.RealTuple newRealTuple(visad.Real[] values, visad.CoordinateSystem coordSys) throws visad.VisADException, java.rmi.RemoteException
values
- The values.coordSys
- The coordinate system transformation. May be
null
, in which case the default
coordinate system transformation is used.RealTuple
.visad.VisADException
- VisAD failure.java.rmi.RemoteException
- Java RMI failure.public visad.DataImpl newValue(double[] amounts, visad.Unit[] units, visad.ErrorEstimate[] errors, visad.CoordinateSystem coordSys) throws visad.VisADException, java.rmi.RemoteException
amounts
- The numerical amounts.units
- The units of the amounts. May be
null
-- in which case the defualt
units are used; otherwise, element
i
is the unit for the respective
numerical amount (and may, itself, be
null
-- in which case the default
unit is used).errors
- The uncertainties of the numerical amounts.
May be null
, in which case the
undertainties are zero; otherwise, element
i
is the uncertainty for the
respectve numerical amount (and may, itself, be
null
-- in which case the
uncertainty is zero).coordSys
- The coordinate system transformation. May be
null
, in which case the default
coordinate system transformation is used.RealTuple
.visad.VisADException
- VisAD failure.java.rmi.RemoteException
- Java RMI failure.public boolean isCompatible(visad.Data data) throws visad.VisADException, java.rmi.RemoteException
MathType
is compatible.data
- The VisAD data object to examine for
compatibility.true
if and only if the MathType of
the VisAD data object is compatible with this
instance.visad.VisADException
- VisAD failure.java.rmi.RemoteException
- Java RMI failure.isCompatible(MathType)
public boolean isCompatible(visad.MathType type) throws visad.VisADException
RealTupleType.equalsExceptNameButUnits(visad.MathType)
method returns true when given
the return value of getRealTupleType()
and if the coordinate
system transformations are compatible. A SetType is compatible if
its RealTupleType is compatible. A FunctionType is compatible if
the MathType of its range is compatible. All other MathTypes are
incompatible.type
- The VisAD MathType to examine for compatibility.true
if and only if the MathType is
compatible with this instance.visad.VisADException
- VisAD failure.public final void vet(visad.Data data) throws visad.TypeException, visad.VisADException, java.rmi.RemoteException
data
- The VisAD data object to examine for
compatibility.visad.TypeException
- The VisAD data object is incompatible with this
quantity.visad.VisADException
- VisAD failure.java.rmi.RemoteException
- Java RMI failure.public final void vet(visad.MathType type) throws visad.VisADException
type
- The VisAD MathType to examine for compatibility.visad.VisADException
- if a core VisAD failure occurs.