|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectvisad.ThingImpl
visad.DataImpl
visad.Scalar
visad.Real
public class Real
Real is the class of VisAD scalar data for real numbers represented as double precision floating point values. Double.NaN is used to indicate missing values, because it has the appropriate arithmetic semantics. Real objects are immutable.
Nested Class Summary |
---|
Nested classes/interfaces inherited from class visad.DataImpl |
---|
DataImpl.Syncher |
Field Summary |
---|
Fields inherited from interface visad.Data |
---|
ABS, ACOS, ACOS_DEGREES, ADD, ASIN, ASIN_DEGREES, ATAN, ATAN_DEGREES, ATAN2, ATAN2_DEGREES, CEIL, COS, COS_DEGREES, DEGREES_TO_RADIANS, DEPENDENT, DIVIDE, EXP, FLOOR, INDEPENDENT, INV_ATAN2, INV_ATAN2_DEGREES, INV_DIVIDE, INV_POW, INV_REMAINDER, INV_SUBTRACT, LOG, MAX, MIN, MULTIPLY, NEAREST_NEIGHBOR, NEGATE, NO_ERRORS, NOP, POW, RADIANS_TO_DEGREES, REMAINDER, RINT, ROUND, SIN, SIN_DEGREES, SQRT, SUBTRACT, TAN, TAN_DEGREES, WEIGHTED_AVERAGE |
Constructor Summary | |
---|---|
Real(double value)
Constructs a generic Real object. |
|
Real(double value,
double error)
Constructs a generic Real object. |
|
Real(RealType type)
Constructs a Real object. |
|
Real(RealType type,
double value)
Constructs a Real object. |
|
Real(RealType type,
double value,
Unit u)
Constructs a Real object. |
|
Real(RealType type,
double value,
Unit u,
double error)
Constructs a Real object. |
|
Real(RealType type,
double value,
Unit u,
ErrorEstimate error)
Constructs a Real object. |
Method Summary | |
---|---|
Data |
adjustSamplingError(Data error,
int error_mode)
return a Real that clones this, except its ErrorEstimate is adjusted for the sampling error in error |
Data |
binary(Data data,
int op,
MathType new_type,
int sampling_mode,
int error_mode)
general binary operation between this and data; op may be Data.ADD, Data.SUBTRACT, etc; these include all binary operations defined for Java primitive data types; new_type is the MathType of the result; sampling_mode may be Data.NEAREST_NEIGHBOR or Data.WEIGHTED_AVERAGE; error_mode may be Data.INDEPENDENT, Data.DEPENDENT or Data.NO_ERRORS |
Real |
cloneButUnit(Unit u)
clone this, but with a new Unit |
Real |
cloneButValue(double value)
clone this, but with a new value |
int |
compareTo(java.lang.Object object)
Compares this Real to another. |
DataShadow |
computeRanges(ShadowType type,
DataShadow shadow)
recursive version of computeRanges; would like 'default' visibility here, but must be declared 'public' because it is defined in the Data interface |
boolean |
equals(java.lang.Object obj)
Indicates if this Real is semantically identical to an object. |
ErrorEstimate |
getError()
Returns the uncertainty in the numeric value of this instance. |
Unit |
getUnit()
Returns the unit of this instance. |
double |
getValue()
Returns the numeric value in the unit of RealIface.getUnit() . |
double |
getValue(Unit unit_out)
get double value converted to unit_out |
int |
hashCode()
Returns the hash code of this Real. |
boolean |
isMissing()
a method to tell whether data object has a missing value |
java.lang.String |
longString(java.lang.String pre)
generates a longer string than generated by toString, indented by pre (a string of blanks) |
static void |
main(java.lang.String[] args)
run 'java visad.Real' to test the Real class |
java.lang.String |
toString()
|
java.lang.String |
toValueString()
Gets a string that represents just the value portion of this Real -- but with full semantics (e.g. |
Data |
unary(int op,
MathType new_type,
int sampling_mode,
int error_mode)
unary function on a Real; override some trig functions based on Unit; transcental functions destroy dimensionfull Unit |
Methods inherited from class visad.Scalar |
---|
addReference, clone, removeReference |
Methods inherited from class visad.DataImpl |
---|
__add__, __add__, __div__, __div__, __mod__, __mod__, __mul__, __mul__, __neg__, __pow__, __pow__, __sub__, __sub__, abs, abs, acos, acos, acosDegrees, acosDegrees, add, add, asin, asin, asinDegrees, asinDegrees, atan, atan, atan2, atan2, atan2Degrees, atan2Degrees, atanDegrees, atanDegrees, binary, ceil, ceil, changeMathType, computeRanges, computeRanges, cos, cos, cosDegrees, cosDegrees, dataClone, divide, divide, exp, exp, floor, floor, getType, local, log, log, longString, max, max, min, min, multiply, multiply, negate, negate, notifyReferences, pow, pow, remainder, remainder, rint, rint, round, round, sin, sin, sinDegrees, sinDegrees, sqrt, sqrt, subtract, subtract, tan, tan, tanDegrees, tanDegrees, unary |
Methods inherited from class java.lang.Object |
---|
finalize, getClass, notify, notifyAll, wait, wait, wait |
Methods inherited from interface visad.Data |
---|
abs, abs, acos, acos, acosDegrees, acosDegrees, add, add, asin, asin, asinDegrees, asinDegrees, atan, atan, atan2, atan2, atan2Degrees, atan2Degrees, atanDegrees, atanDegrees, binary, ceil, ceil, changeMathType, computeRanges, computeRanges, cos, cos, cosDegrees, cosDegrees, dataClone, divide, divide, exp, exp, floor, floor, getType, local, log, log, longString, max, max, min, min, multiply, multiply, negate, negate, pow, pow, remainder, remainder, rint, rint, round, round, sin, sin, sinDegrees, sinDegrees, sqrt, sqrt, subtract, subtract, tan, tan, tanDegrees, tanDegrees, unary |
Methods inherited from interface visad.Thing |
---|
addReference, removeReference |
Constructor Detail |
---|
public Real(RealType type, double value, Unit u, ErrorEstimate error) throws VisADException
type
- The type of the Real.value
- The value of the Real. May be
Double.NaN
.u
- The unit of the Real. May be null
.
If non-null
and
type.isInterval()
returns true,
then the unit will actually be
u.getAbsoluteUnit()
.error
- Error estimate of the Real. May be
null
.
UnitException
- if the default unit of the type is inconvertible
with the unit argument (i.e. if
Unit.canConvert(u, type.getDefaultUnit())
returns false).
VisADException
- Couldn't create necessary VisAD object.public Real(RealType type, double value, Unit u, double error) throws VisADException
type
- The type of the Real.value
- The value of the Real. May be
Double.NaN
.u
- The unit of the Real. May be null
.
If non-null
and
type.isInterval()
returns true,
then the unit will actually be
u.getAbsoluteUnit()
.error
- Value for constructing an error estimate for the
Real in units of u != null &&
type.isInterval() ? u.getAbsoluteUnit() :
u
.
VisADException
- Couldn't create necessary VisAD object.public Real(RealType type, double value, Unit u) throws VisADException
null
.
type
- The type of the Real.value
- The value of the Real. May be
Double.NaN
.u
- The unit of the Real. May be null
.
If non-null
and
type.isInterval()
returns true,
then the unit will actually be
u.getAbsoluteUnit()
.
VisADException
- Couldn't create necessary VisAD object.public Real(RealType type, double value)
null
.
type
- The type of the Real.value
- The value of the Real in units of
type.getDefaultUnit()
. May be
Double.NaN
.public Real(RealType type)
null
.
type
- The type of the Real.public Real(double value, double error)
RealType.Generic
, the unit of the Real will be
RealType.Generic.getDefaultUnit()
, and the error estimate
will be based on a numeric value.
value
- The value of the Real. May be
Double.NaN
.error
- Value for constructing an error estimate for the
Real in units of
RealType.Generic.getDefaultUnit()
.public Real(double value)
RealType.Generic
, the unit of the Real will be
RealType.Generic.getDefaultUnit()
, and the error estimate
will be 0.0.
value
- The value of the Real. May be
Double.NaN
.Method Detail |
---|
public final double getValue()
RealIface
RealIface.getUnit()
.
getValue
in interface RealIface
RealIface.getUnit()
.public final double getValue(Unit unit_out) throws VisADException
getValue
in interface RealIface
VisADException
public boolean isMissing()
Data
isMissing
in interface Data
public Data binary(Data data, int op, MathType new_type, int sampling_mode, int error_mode) throws VisADException, java.rmi.RemoteException
Data
binary
in interface Data
binary
in class DataImpl
VisADException
java.rmi.RemoteException
public Data unary(int op, MathType new_type, int sampling_mode, int error_mode) throws VisADException
unary
in interface Data
unary
in class DataImpl
VisADException
public DataShadow computeRanges(ShadowType type, DataShadow shadow) throws VisADException, java.rmi.RemoteException
Data
computeRanges
in interface Data
VisADException
java.rmi.RemoteException
public Unit getUnit()
RealIface
getUnit
in interface RealIface
public ErrorEstimate getError()
RealIface
getError
in interface RealIface
public Data adjustSamplingError(Data error, int error_mode) throws VisADException, java.rmi.RemoteException
adjustSamplingError
in interface Data
adjustSamplingError
in interface RealIface
adjustSamplingError
in class DataImpl
error
- The uncertainty by which to adjust the clone.error_mode
- The mode for propagating errors. See Data
.
VisADException
- VisAD failure.
java.rmi.RemoteException
- Java RMI failure.public Real cloneButValue(double value) throws VisADException
cloneButValue
in interface RealIface
value
- The numeric value for the clone.
VisADException
- VisAD failure.public Real cloneButUnit(Unit u) throws VisADException
cloneButUnit
in interface RealIface
u
- The unit for the clone.
VisADException
public java.lang.String toString()
toString
in interface RealIface
toString
in class DataImpl
public java.lang.String toValueString()
toValueString
in interface RealIface
public java.lang.String longString(java.lang.String pre) throws VisADException
DataImpl
longString
in interface Data
longString
in class DataImpl
VisADException
public int compareTo(java.lang.Object object)
compareTo
in interface java.lang.Comparable
compareTo
in interface RealIface
object
- The other Real to compare against. It shall be
a Real with a compatible (i.e. convertible)
unit.
ErrorEstimate.compareTo()
method is used
to break the tie.public boolean equals(java.lang.Object obj)
equals
in interface ScalarIface
equals
in class Scalar
obj
- The object.
true
if and only if this Real
is semantically identical to the object.public int hashCode()
hashCode
in interface RealIface
hashCode
in class java.lang.Object
public static void main(java.lang.String[] args) throws VisADException, java.rmi.RemoteException
VisADException
java.rmi.RemoteException
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |