public abstract class ScalarQuantity extends Quantity
DEPENDENT, INDEPENDENT, UNIMPORTANT
Modifier | Constructor and Description |
---|---|
protected |
ScalarQuantity(visad.RealType realType)
Constructs from an existing RealType.
|
protected |
ScalarQuantity(visad.RealType realType,
visad.CoordinateSystem coordSys)
Constructs from a name, an existing RealType, and a coordinate system
transformation.
|
protected |
ScalarQuantity(visad.RealType realType,
visad.CoordinateSystem coordSys,
visad.Set domain)
Constructs from a name, an existing RealType, a coordinate system
transformation, and a default domain set.
|
protected |
ScalarQuantity(java.lang.String name,
visad.Unit unit)
Constructs from a name and a default unit.
|
protected |
ScalarQuantity(java.lang.String name,
visad.Unit unit,
visad.Set set)
Constructs from a name, default unit, and default representational set.
|
protected |
ScalarQuantity(java.lang.String name,
visad.Unit unit,
visad.Set set,
int attrMask)
Constructs from a name, default unit, default representational set, and
an attribute mask.
|
Modifier and Type | Method and Description |
---|---|
visad.MathType |
getMathType()
Returns the natural
MathType of this quantity. |
visad.RealType |
getRealType()
Returns the VisAD RealType of this quantity.
|
boolean |
isCompatible(visad.MathType type)
Indicates if a VisAD MathType is compatible with this instance.
|
visad.Real |
newReal(double amount)
Returns the single value of this quantity corresponding to a numeric
amount in the default unit.
|
visad.Real |
newReal(double amount,
visad.Unit unit)
Returns the single value of this quantity corresponding to a numeric
amount and a unit.
|
visad.Real |
newReal(double amount,
visad.Unit unit,
visad.ErrorEstimate error)
Returns the single value of this quantity corresponding to a numeric
amount, a unit, and an error estimate.
|
visad.RealTuple |
newRealTuple(double amount,
visad.Unit unit)
Returns a single tuple of this quantity.
|
visad.RealTuple |
newRealTuple(double amount,
visad.Unit unit,
visad.CoordinateSystem coordSys)
Returns a single tuple of this quantity.
|
visad.RealTuple |
newRealTuple(double amount,
visad.Unit unit,
visad.ErrorEstimate error,
visad.CoordinateSystem coordSys)
Returns a single tuple of this quantity.
|
visad.RealTuple |
newRealTuple(visad.Real value,
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 the single value of this quantity corresponding to numeric
amounts, units, error estimates, and coordinate system.
|
getName, getRealTupleType, isCompatible, newRealTuple, newRealTuple, newRealTuple, newRealTuple, vet, vet
protected ScalarQuantity(java.lang.String name, visad.Unit unit) throws visad.TypeException, visad.VisADException
FloatSet
.name
- The name of the scalar quantity.unit
- The default unit of the scalar quantity.visad.TypeException
- The VisAD RealType already exists but has an
incompatible unit or representational set.visad.VisADException
- VisAD failure.ScalarQuantity(String name, Unit unit, Set set)
protected ScalarQuantity(java.lang.String name, visad.Unit unit, visad.Set set) throws visad.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
.visad.VisADException
- VisAD failure.ScalarQuantity(String name, Unit unit, Set set, int attrMask)
protected ScalarQuantity(java.lang.String name, visad.Unit unit, visad.Set set, int attrMask) throws visad.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
.visad.VisADException
- VisAD failure.ScalarQuantity(RealType realType)
protected ScalarQuantity(visad.RealType realType) throws visad.TypeException, visad.VisADException
null
.realType
- The existing RealType.visad.TypeException
- if an instance cannot be created.visad.VisADException
- if a core VisAD failure occurs.ScalarQuantity(RealType, CoordinateSystem)
protected ScalarQuantity(visad.RealType realType, visad.CoordinateSystem coordSys) throws visad.TypeException, visad.VisADException
null
.realType
- The existing RealType.coordSys
- The coordinate system transformation.visad.TypeException
- if an instance cannot be created.visad.VisADException
- if a core VisAD failure occurs.ScalarQuantity(RealType, CoordinateSystem, visad.Set)
protected ScalarQuantity(visad.RealType realType, visad.CoordinateSystem coordSys, visad.Set domain) throws visad.TypeException, visad.VisADException
realType
- The existing RealType.coordSys
- The coordinate system transformation.domain
- The default domain set.visad.TypeException
- if an instance cannot be created.visad.VisADException
- if a core VisAD failure occurs.public final visad.RealType getRealType()
public final visad.MathType getMathType()
MathType
of this quantity.getMathType
in class Quantity
MathType
of this quantity.
The class of the object is RealType
.public final visad.Real newReal(double amount) throws visad.VisADException
null
.amount
- The numeric value.visad.VisADException
- VisAD failure.newReal(double amount, Unit unit)
public final visad.Real newReal(double amount, visad.Unit unit) throws visad.VisADException
null
.amount
- The numeric value.unit
- The unit of the numeric value. May be
null
.visad.VisADException
- VisAD failure.newReal(double amount, Unit unit, ErrorEstimate error)
public visad.Real newReal(double amount, visad.Unit unit, visad.ErrorEstimate error) throws visad.VisADException
amount
- The numeric value.unit
- The unit of the numeric value. May be
null
.error
- The error estimate. May be null
.visad.VisADException
- VisAD failure.public final visad.RealTuple newRealTuple(double amount, visad.Unit unit) throws visad.VisADException, java.rmi.RemoteException
amount
- The numeric value.unit
- The unit of the numeric value. May be
null
.visad.VisADException
- VisAD failure.java.rmi.RemoteException
- Java RMI failure.Quantity.newRealTuple(double[], Unit[])
public final visad.RealTuple newRealTuple(double amount, visad.Unit unit, visad.CoordinateSystem coordSys) throws visad.VisADException, java.rmi.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
.visad.VisADException
- VisAD failure.java.rmi.RemoteException
- Java RMI failure.Quantity.newRealTuple(double[], Unit[], CoordinateSystem)
public visad.RealTuple newRealTuple(double amount, visad.Unit unit, visad.ErrorEstimate error, visad.CoordinateSystem coordSys) throws visad.VisADException, java.rmi.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
.visad.VisADException
- VisAD failure.java.rmi.RemoteException
- Java RMI failure.Quantity.newRealTuple(double[], Unit[] ErrorEstimate[], CoordinateSystem)
public visad.RealTuple newRealTuple(visad.Real value, visad.CoordinateSystem coordSys) throws visad.VisADException, java.rmi.RemoteException
value
- The value.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.Quantity.newRealTuple(Real[], CoordinateSystem)
public visad.DataImpl newValue(double[] amounts, visad.Unit[] units, visad.ErrorEstimate[] errors, visad.CoordinateSystem coordSys) throws visad.VisADException
newValue
in class Quantity
amounts
- 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
.visad.VisADException
- VisAD failure.public boolean isCompatible(visad.MathType type) throws visad.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 Quantity
type
- The VisAD MathType to examine for compatibility.true
if and only if the MathType is
compatible with this instance.visad.VisADException
- VisAD failure.