|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectucar.visad.Quantity
ucar.visad.ScalarQuantity
public abstract class ScalarQuantity
Provides support for single-component quantities. This class supports both scalar quantities with and without an associated coordinate system transformation. This is done so that the knowledge and semantics of superclass scalar quantities without associated coordinate system transformations can be inherited by subclass scalar quantities that have associated coordinate system transformations (e.g. ucar.visad.physics.PlaneAngle and ucar.visad.geoscience.Azimuth or ucar.visad.physics.Length and ucar.visad.geoscience.Altitude) -- thus, supporting a hierarchy of scientific scalar quantities without regard to coordinate system relationships.
| Field Summary |
|---|
| Fields inherited from class ucar.visad.Quantity |
|---|
DEPENDENT, INDEPENDENT, UNIMPORTANT |
| Constructor Summary | |
|---|---|
protected |
ScalarQuantity(RealType realType)
Constructs from an existing RealType. |
protected |
ScalarQuantity(RealType realType,
CoordinateSystem coordSys)
Constructs from a name, an existing RealType, and a coordinate system transformation. |
protected |
ScalarQuantity(RealType realType,
CoordinateSystem coordSys,
Set domain)
Constructs from a name, an existing RealType, a coordinate system transformation, and a default domain set. |
protected |
ScalarQuantity(String name,
Unit unit)
Constructs from a name and a default unit. |
protected |
ScalarQuantity(String name,
Unit unit,
Set set)
Constructs from a name, default unit, and default representational set. |
protected |
ScalarQuantity(String name,
Unit unit,
Set set,
int attrMask)
Constructs from a name, default unit, default representational set, and an attribute mask. |
| Method Summary | |
|---|---|
MathType |
getMathType()
Returns the natural MathType of this quantity. |
RealType |
getRealType()
Returns the VisAD RealType of this quantity. |
boolean |
isCompatible(MathType type)
Indicates if a VisAD MathType is compatible with this instance. |
Real |
newReal(double amount)
Returns the single value of this quantity corresponding to a numeric amount in the default unit. |
Real |
newReal(double amount,
Unit unit)
Returns the single value of this quantity corresponding to a numeric amount and a unit. |
Real |
newReal(double amount,
Unit unit,
ErrorEstimate error)
Returns the single value of this quantity corresponding to a numeric amount, a unit, and an error estimate. |
RealTuple |
newRealTuple(double amount,
Unit unit)
Returns a single tuple of this quantity. |
RealTuple |
newRealTuple(double amount,
Unit unit,
CoordinateSystem coordSys)
Returns a single tuple of this quantity. |
RealTuple |
newRealTuple(double amount,
Unit unit,
ErrorEstimate error,
CoordinateSystem coordSys)
Returns a single tuple of this quantity. |
RealTuple |
newRealTuple(Real value,
CoordinateSystem coordSys)
Returns a single tuple of this quantity. |
DataImpl |
newValue(double[] amounts,
Unit[] units,
ErrorEstimate[] errors,
CoordinateSystem coordSys)
Returns the single value of this quantity corresponding to numeric amounts, units, error estimates, and coordinate system. |
| Methods inherited from class ucar.visad.Quantity |
|---|
getName, getRealTupleType, isCompatible, newRealTuple, newRealTuple, newRealTuple, newRealTuple, vet, vet |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
protected ScalarQuantity(String name,
Unit unit)
throws TypeException,
VisADException
FloatSet.
name - The name of the scalar quantity.unit - The default unit of the scalar quantity.
TypeException - The VisAD RealType already exists but has an
incompatible unit or representational set.
VisADException - VisAD failure.ScalarQuantity(String name, Unit unit, Set set)
protected ScalarQuantity(String name,
Unit unit,
Set set)
throws VisADException
name - The name of the scalar quantity.unit - The default unit of the scalar quantity.set - The default representational set of the
quantity. It shall be an instance of
visad.DoubleSet,
visad.FloatSet,
visad.Integer1DSet, or
null. If null, then
the default is visad.FloatSet.
VisADException - VisAD failure.ScalarQuantity(String name, Unit unit, Set set, int attrMask)
protected ScalarQuantity(String name,
Unit unit,
Set set,
int attrMask)
throws VisADException
name - The name of the scalar quantity.unit - The default unit of the scalar quantity.set - The default representational set of the
quantity. It shall be an instance of
visad.DoubleSet,
visad.FloatSet,
visad.Integer1DSet, or
null. If null, then
the default is visad.FloatSet.attrMask - The attribute mask: 0 or
INTERVAL.
VisADException - VisAD failure.ScalarQuantity(RealType realType)
protected ScalarQuantity(RealType realType)
throws TypeException,
VisADException
null.
realType - The existing RealType.
TypeException - if an instance cannot be created.
VisADException - if a core VisAD failure occurs.ScalarQuantity(RealType, CoordinateSystem)
protected ScalarQuantity(RealType realType,
CoordinateSystem coordSys)
throws TypeException,
VisADException
null.
realType - The existing RealType.coordSys - The coordinate system transformation.
TypeException - if an instance cannot be created.
VisADException - if a core VisAD failure occurs.ScalarQuantity(RealType, CoordinateSystem, visad.Set)
protected ScalarQuantity(RealType realType,
CoordinateSystem coordSys,
Set domain)
throws TypeException,
VisADException
realType - The existing RealType.coordSys - The coordinate system transformation.domain - The default domain set.
TypeException - if an instance cannot be created.
VisADException - if a core VisAD failure occurs.| Method Detail |
|---|
public final RealType getRealType()
public final MathType getMathType()
MathType of this quantity.
getMathType in class QuantityMathType of this quantity.
The class of the object is RealType.
public final Real newReal(double amount)
throws VisADException
null.
amount - The numeric value.
VisADException - VisAD failure.newReal(double amount, Unit unit)
public final Real newReal(double amount,
Unit unit)
throws VisADException
null.
amount - The numeric value.unit - The unit of the numeric value. May be
null.
VisADException - VisAD failure.newReal(double amount, Unit unit, ErrorEstimate error)
public Real newReal(double amount,
Unit unit,
ErrorEstimate error)
throws VisADException
amount - The numeric value.unit - The unit of the numeric value. May be
null.error - The error estimate. May be null.
VisADException - VisAD failure.
public final RealTuple newRealTuple(double amount,
Unit unit)
throws VisADException,
RemoteException
amount - The numeric value.unit - The unit of the numeric value. May be
null.
VisADException - VisAD failure.
RemoteException - Java RMI failure.Quantity.newRealTuple(double[], Unit[])
public final RealTuple newRealTuple(double amount,
Unit unit,
CoordinateSystem coordSys)
throws VisADException,
RemoteException
amount - The numeric value.unit - The unit of the numeric value. May be
null.coordSys - The coordinate system transformation for this
particular tuple. Must be compatible with the
default coordinate system transformation. May
be null.
VisADException - VisAD failure.
RemoteException - Java RMI failure.Quantity.newRealTuple(double[], Unit[], CoordinateSystem)
public RealTuple newRealTuple(double amount,
Unit unit,
ErrorEstimate error,
CoordinateSystem coordSys)
throws VisADException,
RemoteException
amount - The numeric value.unit - The unit of the numeric value. May be
null.error - The error estimate. May be null.coordSys - The coordinate system transformation for this
particular tuple. Must be compatible with the
default coordinate system transformation. May
be null.
VisADException - VisAD failure.
RemoteException - Java RMI failure.Quantity.newRealTuple(double[], Unit[] ErrorEstimate[], CoordinateSystem)
public RealTuple newRealTuple(Real value,
CoordinateSystem coordSys)
throws VisADException,
RemoteException
value - The value.coordSys - The coordinate system transformation. May be
null, in which case the default
coordinate system transformation is used.
RealTuple.
VisADException - VisAD failure.
RemoteException - Java RMI failure.Quantity.newRealTuple(Real[], CoordinateSystem)
public DataImpl newValue(double[] amounts,
Unit[] units,
ErrorEstimate[] errors,
CoordinateSystem coordSys)
throws VisADException
newValue in class Quantityamounts - The numerical amounts. Must have only a single
element.units - The units of the amounts. May be
null; otherwise, must have only
a single element, which is the unit for the
respective numerical amount (and may, itself, be
null).errors - The uncertainties of the numerical amounts. May
be null; otherwise, must have only
a single element, which is the uncertainty of
the numerical amount (and may, itself, be
null).coordSys - The coordinate system transformation. Must be
null.
Real.
VisADException - VisAD failure.
public boolean isCompatible(MathType type)
throws VisADException
RealType.equalsExceptNameButUnits(visad.MathType)
method returns true when given the return value of getRealType() and if this quantity has no coordinate system
transformation. A RealTupleType is compatible if its RealTupleType.equalsExceptNameButUnits(visad.MathType) method returns true when given
the return value of Quantity.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.
isCompatible in class Quantitytype - The VisAD MathType to examine for compatibility.
true if and only if the MathType is
compatible with this instance.
VisADException - VisAD failure.
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||