visad
Class RealType
- java.lang.Object
-
- visad.MathType
-
- visad.ScalarType
-
- visad.RealType
-
- All Implemented Interfaces:
- java.io.Serializable, java.lang.Comparable
- Direct Known Subclasses:
- DisplayRealType, Quantity
public class RealType extends ScalarType
RealType is the VisAD scalar data type for real number variables.- See Also:
- Serialized Form
-
-
Field Summary
Fields Modifier and Type Field and Description static RealTypeAltitudestatic RealTypeDeclinationastronomical coordinatesstatic RealTypeGenericgeneric RealTypestatic intINTERVALThe interval attribute.static RealTypeLatitudeSpherical spatial coordinate for Latitudestatic RealTypeLongitudeSpherical spatial coordinate for Longitudestatic RealTypeRadiusstatic RealTypeRightAscensionstatic RealTypeTimeTimestamp coordinatestatic RealTypeTimeIntervalTemporal-interval coordinatestatic RealTypeXAxisCartesian spatial coordinate - X axisstatic RealTypeYAxisCartesian spatial coordinate - Y axisstatic RealTypeZAxisCartesian spatial coordinate - Z axis
-
Constructor Summary
Constructors Constructor and Description RealType(java.lang.String name)Deprecated.RealType(java.lang.String name, int attrMask)Deprecated.RealType(java.lang.String name, Unit u)Deprecated.RealType(java.lang.String name, Unit u, Set set)Deprecated.RealType(java.lang.String name, Unit u, Set set, int attrMask)Deprecated.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method and Description MathTypebinary(MathType type, int op, java.util.Vector names)ShadowTypebuildShadowType(DataDisplayLink link, ShadowType parent)MathTypecloneDerivative(RealType d_partial)booleanequals(java.lang.Object type)Check the equality of type with this RealType; two RealType-s are equal if they have the same name, convertible DefaultUnit-s, same DefaultSet and attrMask; a RealType copied from a remote Java virtual machine may have the same name but different values for other fieldsbooleanequalsExceptName(MathType type)any two RealType-s are equal except NamebooleanequalsExceptNameButUnits(MathType type)Check to see if type has convertible units with this RealType.intgetAttributeMask()Gets the attribute mask of this RealType.SetgetDefaultSet()get default SetUnitgetDefaultUnit()get default Unitstatic RealTypegetRealType(java.lang.String name)Returns a RealType corresponding to a name.static RealTypegetRealType(java.lang.String name, int attrMask)Returns a RealType corresponding to a name and attribute mask.static RealTypegetRealType(java.lang.String name, Unit u)Returns a RealType corresponding to a name and unit.static RealTypegetRealType(java.lang.String name, Unit u, int attrMask)Returns a RealType corresponding to a name, unit, and attribute mask.static RealTypegetRealType(java.lang.String name, Unit u, Set set)Returns a RealType corresponding to a name, unit, and representational set.static RealTypegetRealType(java.lang.String name, Unit u, Set set, int attrMask)Returns a RealType corresponding to a name, unit, representational set, and attribute mask.static RealTypegetRealTypeByName(java.lang.String name)return any RealType constructed in this JVM with name, or nullbooleanisInterval()Indicates whether or not this RealType refers to an interval (e.g.static voidmain(java.lang.String[] args)DatamissingData()returns a missing Data object for any MathTypejava.lang.StringprettyString(int indent)voidsetDefaultSet(Set sampling)set the default Set; this is a violation of MathType immutability to allow a a RealType to be an argument (directly or through a SetType) to the constructor of its default Set; this method throws an Exception if getDefaultSet has previously been invokedMathTypeunary(int op, java.util.Vector names)-
Methods inherited from class visad.ScalarType
alias, compareTo, getAlias, getName, getNameWithBlanks, getOriginalName, getScalarTypeByName, hashCode, validateName
-
Methods inherited from class visad.MathType
addTimeAlias, findScalarType, guessMaps, prettyString, stringToType, toString
-
-
-
-
Field Detail
-
INTERVAL
public static final int INTERVAL
The interval attribute. This attribute should be used during construction of a RealType if the RealType refers to an interval (e.g. length difference, delta temperature). In general, RealType-s that are temporal in nature should have this attribute because the "time" variable in most formulae actually refer to time differences (e.g. "time since the beginning of the experiment"). One obvious exception to this lies with cosmology, where "time" is absolute rather than an interval.- See Also:
- Constant Field Values
-
XAxis
public static final RealType XAxis
Cartesian spatial coordinate - X axis
-
YAxis
public static final RealType YAxis
Cartesian spatial coordinate - Y axis
-
ZAxis
public static final RealType ZAxis
Cartesian spatial coordinate - Z axis
-
Latitude
public static final RealType Latitude
Spherical spatial coordinate for Latitude
-
Longitude
public static final RealType Longitude
Spherical spatial coordinate for Longitude
-
Altitude
public static final RealType Altitude
-
Radius
public static final RealType Radius
-
TimeInterval
public static final RealType TimeInterval
Temporal-interval coordinate
-
Time
public static final RealType Time
Timestamp coordinate
-
Declination
public static final RealType Declination
astronomical coordinates
-
RightAscension
public static final RealType RightAscension
-
Generic
public static final RealType Generic
generic RealType
-
-
Constructor Detail
-
RealType
public RealType(java.lang.String name) throws VisADExceptionDeprecated. UsegetRealType(String)Constructs from a name (two RealTypes are equal if their names are equal). Assumesnullfor the default Unit and default Set and that the RealType does not refer to an interval.- Parameters:
name- The name for the RealType.- Throws:
VisADException- Couldn't create necessary VisAD object.
-
RealType
public RealType(java.lang.String name, int attrMask) throws VisADExceptionDeprecated. UsegetRealType(String, int)Constructs from a name (two RealTypes are equal if their names are equal) and whether or not the RealType refers to an interval (e.g. length difference, delta temperature). Assumesnullfor the default Unit and default Set.- Parameters:
name- The name for the RealType.attrMask- The attribute mask. 0 or INTERVAL.- Throws:
VisADException- Couldn't create necessary VisAD object.
-
RealType
public RealType(java.lang.String name, Unit u, Set set) throws VisADExceptionDeprecated. UsegetRealType(String, Unit, Set)Constructs from a name (two RealTypes are equal if their names are equal) a default Unit, and a default Set. Assumes that the RealType does not refer to an interval.- Parameters:
name- The name for the RealType.u- The default unit for the RealType. May benull.set- The default sampling set for the RealType. Used when this type is a FunctionType domain. May benull.- Throws:
VisADException- Couldn't create necessary VisAD object.
-
RealType
public RealType(java.lang.String name, Unit u) throws VisADExceptionDeprecated. UsegetRealType(String, Unit)Constructs from a name (two RealTypes are equal if their names are equal) and a default Unit. Assumes the default Set, and that the RealType does not refer to an interval.- Parameters:
name- The name for the RealType.u- The default unit for the RealType. May benull.- Throws:
VisADException- Couldn't create necessary VisAD object.
-
RealType
public RealType(java.lang.String name, Unit u, Set set, int attrMask) throws VisADExceptionDeprecated. UsegetRealType(String, Unit, Set, int)Constructs from a name (two RealTypes are equal if their names are equal) a default Unit, a default Set, and whether or not the RealType refers to an interval (e.g. length difference, delta temperature). This is the most general, public constructor.- Parameters:
name- The name for the RealType.u- The default unit for the RealType. May benull. If non-nulland the RealType refers to an interval, then the default unit will actually beu.getAbsoluteUnit().set- The default sampling set for the RealType. Used when this type is a FunctionType domain. May benull.attrMask- The attribute mask. 0 or INTERVAL.- Throws:
VisADException- Couldn't create necessary VisAD object.
-
-
Method Detail
-
getAttributeMask
public final int getAttributeMask()
Gets the attribute mask of this RealType.- Returns:
- The attribute mask of this RealType.
-
isInterval
public final boolean isInterval()
Indicates whether or not this RealType refers to an interval (e.g. length difference, delta temperature).- Returns:
- Whether or not this RealType refers to an interval.
-
getDefaultUnit
public Unit getDefaultUnit()
get default Unit
-
getDefaultSet
public Set getDefaultSet()
get default Set
-
setDefaultSet
public void setDefaultSet(Set sampling) throws VisADException
set the default Set; this is a violation of MathType immutability to allow a a RealType to be an argument (directly or through a SetType) to the constructor of its default Set; this method throws an Exception if getDefaultSet has previously been invoked- Throws:
VisADException
-
equals
public boolean equals(java.lang.Object type)
Check the equality of type with this RealType; two RealType-s are equal if they have the same name, convertible DefaultUnit-s, same DefaultSet and attrMask; a RealType copied from a remote Java virtual machine may have the same name but different values for other fields- Overrides:
equalsin classScalarType- Parameters:
type- object in question- Returns:
- true if type is a RealType and the conditions above are met
-
equalsExceptName
public boolean equalsExceptName(MathType type)
any two RealType-s are equal except Name- Specified by:
equalsExceptNamein classMathType
-
equalsExceptNameButUnits
public boolean equalsExceptNameButUnits(MathType type)
Check to see if type has convertible units with this RealType.- Specified by:
equalsExceptNameButUnitsin classMathType- Parameters:
type- MathType to check- Returns:
- true if type is a RealType or a RealTupleType of dimension 1 AND the units are convertible with this RealType's default Unit.
-
cloneDerivative
public MathType cloneDerivative(RealType d_partial) throws VisADException
- Specified by:
cloneDerivativein classMathType- Throws:
VisADException
-
binary
public MathType binary(MathType type, int op, java.util.Vector names) throws VisADException
- Specified by:
binaryin classMathType- Throws:
VisADException
-
unary
public MathType unary(int op, java.util.Vector names) throws VisADException
- Specified by:
unaryin classMathType- Throws:
VisADException
-
missingData
public Data missingData() throws VisADException
Description copied from class:MathTypereturns a missing Data object for any MathType- Specified by:
missingDatain classMathType- Throws:
VisADException
-
getRealType
public static final RealType getRealType(java.lang.String name)
Returns a RealType corresponding to a name. If a RealType with the given name doesn't exist, then it's created (with default unit, representational set, and attribute mask) and returned; otherwise, the previously existing RealType is returned if it is compatible with the input arguments (the unit, representational set, and attribute mask are ignored in the comparison); otherwisenullis returned.- Parameters:
name- The name for the RealType.- Returns:
- A RealType corresponding to the input
arguments or
null. - Throws:
java.lang.NullPointerException- if the name isnull.
-
getRealType
public static final RealType getRealType(java.lang.String name, Unit u)
Returns a RealType corresponding to a name and unit. If a RealType with the given name doesn't exist, then it's created (with default representational set and attribute mask) and returned; otherwise, the previously existing RealType is returned if it is compatible with the input arguments (the representational set and attribute mask are ignored in the comparison); otherwisenullis returned. Note that the unit of the returned RealType will be convertible with the unit argument but might not equal it.- Parameters:
name- The name for the RealType.u- The unit for the RealType.- Returns:
- A RealType corresponding to the input
arguments or
null. - Throws:
java.lang.NullPointerException- if the name isnull.
-
getRealType
public static RealType getRealType(java.lang.String name, int attrMask)
Returns a RealType corresponding to a name and attribute mask. If a RealType with the given name doesn't exist, then it's created (with default unit and representational set) and returned; otherwise, the previously existing RealType is returned if it is compatible with the input arguments (the unit and representational set are ignored in the comparison); otherwisenullis returned. Note that the unit of the returned RealType will be convertible with the unit argument but might not equal it.- Parameters:
name- The name for the RealType.attrMask- The attribute mask for the RealType.- Returns:
- A RealType corresponding to the input
arguments or
null. - Throws:
java.lang.NullPointerException- if the name isnull.
-
getRealType
public static RealType getRealType(java.lang.String name, Unit u, Set set)
Returns a RealType corresponding to a name, unit, and representational set. If a RealType with the given name doesn't exist, then it's created (with a default attribute mask) and returned; otherwise, the previously existing RealType is returned if it is compatible with the input arguments (the attribute mask is ignored in the comparison); otherwisenullis returned. Note that the unit of the returned RealType will be convertible with the unit argument but might not equal it.- Parameters:
name- The name for the RealType.u- The unit for the RealType.set- The representational set for the RealType.- Returns:
- A RealType corresponding to the input
arguments or
null. - Throws:
java.lang.NullPointerException- if the name isnull.
-
getRealType
public static final RealType getRealType(java.lang.String name, Unit u, int attrMask)
Returns a RealType corresponding to a name, unit, and attribute mask. If a RealType with the given name doesn't exist, then it's created (with a default representational set) and returned; otherwise, the previously existing RealType is returned if it is compatible with the input arguments (the representational set is ignored in the comparison); otherwisenullis returned. Note that the unit of the returned RealType will be convertible with the unit argument but might not equal it.- Parameters:
name- The name for the RealType.u- The unit for the RealType.attrMask- The attribute mask for the RealType.- Returns:
- A RealType corresponding to the input
arguments or
null. - Throws:
java.lang.NullPointerException- if the name isnull.
-
getRealType
public static final RealType getRealType(java.lang.String name, Unit u, Set set, int attrMask)
Returns a RealType corresponding to a name, unit, representational set, and attribute mask. If a RealType with the given name doesn't exist, then it's created and returned; otherwise, the previously existing RealType is returned if it is compatible with the input arguments; otherwisenullis returned. Note that the unit of the returned RealType will be convertible with the unit argument but might not equal it.- Parameters:
name- The name for the RealType.u- The unit for the RealType.set- The representational set for the RealType.attrMask- The attribute mask for the RealType.- Returns:
- A RealType corresponding to the input
arguments or
null. - Throws:
java.lang.NullPointerException- if the name isnull.
-
getRealTypeByName
public static RealType getRealTypeByName(java.lang.String name)
return any RealType constructed in this JVM with name, or null
-
buildShadowType
public ShadowType buildShadowType(DataDisplayLink link, ShadowType parent) throws VisADException, java.rmi.RemoteException
- Specified by:
buildShadowTypein classMathType- Throws:
VisADExceptionjava.rmi.RemoteException
-
prettyString
public java.lang.String prettyString(int indent)
- Specified by:
prettyStringin classMathType
-
main
public static void main(java.lang.String[] args) throws VisADException- Throws:
VisADException
-
-
DMelt 3.0 © DataMelt by jWork.ORG