visad
Class RealTuple
- java.lang.Object
-
- visad.ThingImpl
-
- visad.DataImpl
-
- visad.Tuple
-
- visad.RealTuple
-
- All Implemented Interfaces:
- java.io.Serializable, java.lang.Cloneable, Data, RealTupleIface, Thing, TupleIface
- Direct Known Subclasses:
- DoubleTuple, EarthLocationLite, EarthLocationTuple, LatLonTuple, UTMCoordinate
public class RealTuple extends Tuple implements RealTupleIface
RealTuple is the VisAD data class for vectors in R^n for n>0. RealTuple objects are immutable.- See Also:
- Serialized Form
-
-
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
Constructors Constructor and Description RealTuple(Real[] reals)construct a RealTuple according to an array of Real objectsRealTuple(RealTupleType type)construct a RealTuple object with the missing valueRealTuple(RealTupleType type, double[] values)Construct a RealTuple according to a RealTupleType and a double arrayRealTuple(RealTupleType type, Real[] reals, CoordinateSystem coord_sys)construct a RealTuple according to an array of Real objects; coordinate_system may be null; otherwise coordinate_system.getReference() must equal type.getCoordinateSystem.getReference()RealTuple(RealTupleType type, Real[] reals, CoordinateSystem coord_sys, Unit[] units, boolean checkUnits)Construct a RealTuple according to an array of Real objects; coordinate_system may be null; otherwise coordinate_system.getReference() must equal type.getCoordinateSystem.getReference()
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method and Description voidaddReference(ThingReference listener)Adds a listener for changes to this instance.Databinary(Data data, int op, MathType new_type, int sampling_mode, int error_mode)Pointwise binary operation between this and data.java.lang.Objectclone()Clones this instance.DataShadowcomputeRanges(ShadowType type, DataShadow shadow)Recursive version of computeRanges(), called down through Data object tree.CoordinateSystemgetCoordinateSystem()get CoordinateSystemErrorEstimate[]getErrors()get ErrorEstimates of Real componentsUnit[]getTupleUnits()get Units of Real componentsdouble[]getValues()Get the values of the Real componentsjava.lang.StringlongString(java.lang.String pre)static voidmain(java.lang.String[] args)run 'java visad.RealTuple' to test the RealTuple classvoidremoveReference(ThingReference listener)Removes a listener for changes to this instance.java.lang.StringtoString()Provide a String representation of this RealTuple.Dataunary(int op, MathType new_type, int sampling_mode, int error_mode)Pointwise unary operation applied to this.-
Methods inherited from class visad.Tuple
__getitem__, __len__, adjustSamplingError, buildTupleType, equals, getComponent, getComponents, getComponents, getDimension, getLength, getRealComponents, hashCode, isMissing, makeTuple
-
Methods inherited from class visad.DataImpl
__add__, __add__, __div__, __div__, __mod__, __mod__, __mul__, __mul__, __neg__, __pow__, __pow__, __radd__, __rdiv__, __rmod__, __rmul__, __rpow__, __rsub__, __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 interface visad.TupleIface
adjustSamplingError, getComponent, getDimension, getRealComponents, isMissing
-
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
-
-
-
-
Constructor Detail
-
RealTuple
public RealTuple(RealTupleType type)
construct a RealTuple object with the missing value- Parameters:
type- RealTupleType of this RealTuple
-
RealTuple
public RealTuple(RealTupleType type, Real[] reals, CoordinateSystem coord_sys) throws VisADException, java.rmi.RemoteException
construct a RealTuple according to an array of Real objects; coordinate_system may be null; otherwise coordinate_system.getReference() must equal type.getCoordinateSystem.getReference()- Parameters:
type- RealTupleType of this RealTuplereals- array of realscoord_sys- CoordinateSystem for this RealTuple- Throws:
VisADExceptionjava.rmi.RemoteException
-
RealTuple
public RealTuple(RealTupleType type, Real[] reals, CoordinateSystem coord_sys, Unit[] units, boolean checkUnits) throws VisADException, java.rmi.RemoteException
Construct a RealTuple according to an array of Real objects; coordinate_system may be null; otherwise coordinate_system.getReference() must equal type.getCoordinateSystem.getReference()- Parameters:
type- RealTupleType of this RealTuplereals- array of realscoord_sys- CoordinateSystem for this RealTupleunits- array of Units corresponding to the array of Reals.checkUnits- true to make sure the units of the Reals are convertible with the RealType units. NB: setting this to false can cause problems if the units are not convertible. Only do this if you know what you are doing.- Throws:
VisADExceptionjava.rmi.RemoteException
-
RealTuple
public RealTuple(Real[] reals) throws VisADException, java.rmi.RemoteException
construct a RealTuple according to an array of Real objects- Parameters:
reals- array of reals- Throws:
VisADExceptionjava.rmi.RemoteException
-
RealTuple
public RealTuple(RealTupleType type, double[] values) throws VisADException, java.rmi.RemoteException
Construct a RealTuple according to a RealTupleType and a double array- Parameters:
type- RealTupleType of this RealTuplevalues- values for each component. Units are the default units of the RealTupleType components.- Throws:
VisADExceptionjava.rmi.RemoteException
-
-
Method Detail
-
addReference
public final void addReference(ThingReference listener)
Adds a listener for changes to this instance. Because instances of this class don't change, this method does nothing.- Specified by:
addReferencein interfaceThing- Overrides:
addReferencein classThingImpl- Parameters:
listener- The listener for changes.
-
removeReference
public final void removeReference(ThingReference listener)
Removes a listener for changes to this instance. Because instances of this class don't change, this method does nothing.- Specified by:
removeReferencein interfaceThing- Overrides:
removeReferencein classThingImpl- Parameters:
listener- The change listener to be removed.
-
getValues
public double[] getValues()
Get the values of the Real components- Specified by:
getValuesin interfaceRealTupleIface- Returns:
- double array of the values of each Real component
-
getTupleUnits
public Unit[] getTupleUnits()
get Units of Real components- Specified by:
getTupleUnitsin interfaceRealTupleIface- Returns:
- The units of the components.
-
getErrors
public ErrorEstimate[] getErrors() throws VisADException, java.rmi.RemoteException
get ErrorEstimates of Real components- Specified by:
getErrorsin interfaceRealTupleIface- Returns:
- The uncertainties of the components.
- Throws:
VisADException- VisAD failure.java.rmi.RemoteException- Java RMI failure.
-
getCoordinateSystem
public CoordinateSystem getCoordinateSystem()
get CoordinateSystem- Specified by:
getCoordinateSystemin interfaceRealTupleIface- Returns:
- The coordinate system transformation. May be
null.
-
binary
public Data binary(Data data, int op, MathType new_type, int sampling_mode, int error_mode) throws VisADException, java.rmi.RemoteException
Description copied from class:DataImplPointwise binary operation between this and data. Applies to Reals, Tuples (recursively to components), and to Field ranges (Field domains implicitly resampled if necessary). Does not apply to Field domains or Sets (regarded as domains of Fields wthout ranges). Data.ADD is only op defined for Text, interpreted as concatenate. MathTypes of this and data must match, or one may match the range of the other if it is a FunctionType.- Specified by:
binaryin interfaceData- Specified by:
binaryin interfaceTupleIface- Overrides:
binaryin classTuple- Parameters:
data- other Data operand for binary operationop- may be Data.ADD, Data.SUBTRACT, etc; these include all binary operations defined for Java primitive data typesnew_type- MathType of the resultsampling_mode- may be Data.NEAREST_NEIGHBOR or Data.WEIGHTED_AVERAGEerror_mode- may be Data.INDEPENDENT, Data.DEPENDENT or Data.NO_ERRORS;- Returns:
- result, with MathType = new_type
- Throws:
VisADException- a VisAD error occurredjava.rmi.RemoteException- an RMI error occurred
-
unary
public Data unary(int op, MathType new_type, int sampling_mode, int error_mode) throws VisADException, java.rmi.RemoteException
Description copied from class:DataImplPointwise unary operation applied to this. Applies to Reals, Tuples (recursively to components), and to Field ranges (Field domains implicitly resampled if necessary). Does not apply to Field domains, Sets (regarded as domains of Fields wthout ranges) or Text.- Specified by:
unaryin interfaceData- Specified by:
unaryin interfaceTupleIface- Overrides:
unaryin classTuple- Parameters:
op- may be Data.ABS, Data.ACOS, etc; these include all unary operations defined for Java primitive data typesnew_type- MathType of the resultsampling_mode- may be Data.NEAREST_NEIGHBOR or Data.WEIGHTED_AVERAGEerror_mode- may be Data.INDEPENDENT, Data.DEPENDENT or Data.NO_ERRORS;- Returns:
- result, with MathType = new_type
- Throws:
VisADException- a VisAD error occurredjava.rmi.RemoteException- an RMI error occurred
-
computeRanges
public DataShadow computeRanges(ShadowType type, DataShadow shadow) throws VisADException, java.rmi.RemoteException
Description copied from interface:DataRecursive version of computeRanges(), called down through Data object tree.- Specified by:
computeRangesin interfaceData- Specified by:
computeRangesin interfaceTupleIface- Overrides:
computeRangesin classTuple- Parameters:
type- ShadowType generated for MathType of thisshadow- DataShadow instance whose contained double[][] array and animation sampling Set are modified according to RealType values in this, and used as return value- Returns:
- DataShadow instance containing double[][] array of RealType ranges, and an animation sampling Set
- Throws:
VisADException- a VisAD error occurredjava.rmi.RemoteException- an RMI error occurred
-
clone
public final java.lang.Object clone()
Clones this instance.- Specified by:
clonein interfaceRealTupleIface- Overrides:
clonein classTuple- Returns:
- A clone of this instance.
-
toString
public java.lang.String toString()
Provide a String representation of this RealTuple.- Specified by:
toStringin interfaceRealTupleIface- Overrides:
toStringin classDataImpl- Returns:
- a String representation of this
-
longString
public java.lang.String longString(java.lang.String pre) throws VisADException, java.rmi.RemoteException- Specified by:
longStringin interfaceData- Specified by:
longStringin interfaceTupleIface- Overrides:
longStringin classTuple- Parameters:
pre- String added to start of each line- Returns:
- a longer String than returned by toString(), indented by pre (a string of blanks)
- Throws:
VisADExceptionjava.rmi.RemoteException
-
main
public static void main(java.lang.String[] args) throws VisADException, java.rmi.RemoteExceptionrun 'java visad.RealTuple' to test the RealTuple class- Throws:
VisADExceptionjava.rmi.RemoteException
-
-
DMelt 3.0 © DataMelt by jWork.ORG