visad
Class MathType
- java.lang.Object
-
- visad.MathType
-
- All Implemented Interfaces:
- java.io.Serializable
- Direct Known Subclasses:
- FunctionType, ScalarType, SetType, TupleType
public abstract class MathType extends java.lang.Object implements java.io.SerializableMathType is the superclass for VisAD's hierarchy of mathematical types. It encompasses the mathematical concepts of scalars, tuples (i.e., n-dimensional vectors), functions, and certain forms of sets.VisAD Data objects are finite approximations to math objects. Every Data object possesses a MathType, which characterizes the mathematical object that the data approximate. This MathType is not synonymous with the class of the Data object, even though the class names for a Data object and its corresponding MathType object (Set and SetType, e.g.) may be similar.
MathType objects are immutable; one implication is that the setDefaultSet method (in RealTupleType) can be invoked only prior to using the related getDefaultSet method.
- See Also:
- Serialized Form
-
-
Constructor Summary
Constructors Constructor and Description MathType()this constructor assumes it is not creating an instrinsic MathType
-
Method Summary
All Methods Static Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method and Description static voidaddTimeAlias(java.lang.String name)Adds a ScalarType name that guessMaps should map to Animation.abstract MathTypebinary(MathType type, int op, java.util.Vector names)abstract ShadowTypebuildShadowType(DataDisplayLink link, ShadowType parent)abstract MathTypecloneDerivative(RealType d_partial)abstract booleanequals(java.lang.Object type)ScalarTypes are equal if they have the same name; TupleTypes are equal if their components are equal; FunctionTypes are equal if their domains and ranges are equalabstract booleanequalsExceptName(MathType type)this is useful for determining compatibility of Data objects for binary mathematical operations; any RealTypes are equal; any TextTypes are equal; TupleTypes are equal if their components are equal; FunctionTypes are equal if their domains and ranges are equalabstract booleanequalsExceptNameButUnits(MathType type)static booleanfindScalarType(MathType mt, ScalarType st)return true if st occurs in mtScalarMap[]guessMaps(boolean threeD)Guesses at a set of "default" mappings for this MathType.static voidmain(java.lang.String[] args)run 'java visad.MathType' to test MathType.prettyString() and MathType.guessMaps()abstract DatamissingData()returns a missing Data object for any MathTypejava.lang.StringprettyString()return a String that indents complex MathTypes for human readabilityabstract java.lang.StringprettyString(int indent)static MathTypestringToType(java.lang.String s)create a MathType from its string representation; essentially the inverse of the prettyString methodjava.lang.StringtoString()abstract MathTypeunary(int op, java.util.Vector names)
-
-
-
Constructor Detail
-
MathType
public MathType()
this constructor assumes it is not creating an instrinsic MathType
-
-
Method Detail
-
equals
public abstract boolean equals(java.lang.Object type)
ScalarTypes are equal if they have the same name; TupleTypes are equal if their components are equal; FunctionTypes are equal if their domains and ranges are equal- Overrides:
equalsin classjava.lang.Object
-
equalsExceptName
public abstract boolean equalsExceptName(MathType type)
this is useful for determining compatibility of Data objects for binary mathematical operations; any RealTypes are equal; any TextTypes are equal; TupleTypes are equal if their components are equal; FunctionTypes are equal if their domains and ranges are equal
-
equalsExceptNameButUnits
public abstract boolean equalsExceptNameButUnits(MathType type) throws VisADException
- Throws:
VisADException
-
cloneDerivative
public abstract MathType cloneDerivative(RealType d_partial) throws VisADException
- Throws:
VisADException
-
binary
public abstract MathType binary(MathType type, int op, java.util.Vector names) throws VisADException
- Throws:
VisADException
-
unary
public abstract MathType unary(int op, java.util.Vector names) throws VisADException
- Throws:
VisADException
-
missingData
public abstract Data missingData() throws VisADException, java.rmi.RemoteException
returns a missing Data object for any MathType- Throws:
VisADExceptionjava.rmi.RemoteException
-
buildShadowType
public abstract ShadowType buildShadowType(DataDisplayLink link, ShadowType parent) throws VisADException, java.rmi.RemoteException
- Throws:
VisADExceptionjava.rmi.RemoteException
-
toString
public java.lang.String toString()
- Overrides:
toStringin classjava.lang.Object
-
prettyString
public java.lang.String prettyString()
return a String that indents complex MathTypes for human readability
-
prettyString
public abstract java.lang.String prettyString(int indent)
-
stringToType
public static MathType stringToType(java.lang.String s) throws VisADException
create a MathType from its string representation; essentially the inverse of the prettyString method- Throws:
VisADException
-
addTimeAlias
public static void addTimeAlias(java.lang.String name)
Adds a ScalarType name that guessMaps should map to Animation.
-
guessMaps
public ScalarMap[] guessMaps(boolean threeD)
Guesses at a set of "default" mappings for this MathType. Intuitively, first we look for a FunctionType with domain dimension 3, then a nested group of FunctionTypes with 'cumulative' domain dimension 3. Next we look for a FunctionType or nested group of FunctionTypes with domain dimension 2. Then, we look for a FunctionType with domain dimension 1. Nested groups of FunctionTypes may be nested with TupleTypes, which is indicated by some of the MathType templates. Lastly, if no matching FunctionTypes are found, then we look for 3-D, 2-D, or 1-D SetTypes.
-
findScalarType
public static boolean findScalarType(MathType mt, ScalarType st) throws VisADException
return true if st occurs in mt- Throws:
VisADException
-
main
public static void main(java.lang.String[] args) throws VisADException, java.rmi.RemoteExceptionrun 'java visad.MathType' to test MathType.prettyString() and MathType.guessMaps()- Throws:
VisADExceptionjava.rmi.RemoteException
-
-
DMelt 3.0 © DataMelt by jWork.ORG