visad
Class TupleType

java.lang.Object
  extended by visad.MathType
      extended by visad.TupleType
All Implemented Interfaces:
Serializable
Direct Known Subclasses:
RealTupleType

public class TupleType
extends MathType

TupleType is the general VisAD data type for vectors.

See Also:
Serialized Form

Constructor Summary
TupleType(MathType[] types)
          array of component types
 
Method Summary
 MathType __getitem__(int index)
          A wrapper around getComponent for JPython.
 int __len__()
          A wrapper around getComponents for JPython.
 MathType binary(MathType type, int op, Vector names)
           
 ShadowType buildShadowType(DataDisplayLink link, ShadowType parent)
           
 MathType cloneDerivative(RealType d_partial)
           
 boolean equals(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
 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
 boolean equalsExceptNameButUnits(MathType type)
           
 MathType getComponent(int i)
          return component for i between 0 and getDimension() - 1
 MathType[] getComponents()
          get array of components
 int getDimension()
          get number of components
 boolean getFlat()
          Is this a "flat" tuple?
 int getIndex(MathType type)
          return index of first component with type; if no such component, return -1
 int getIndex(String name)
          return index of first RealType component with name; if no such component, return -1
 int getNumberOfRealComponents()
           
 RealType[] getRealComponents()
           
 int hashCode()
           
 Data missingData()
          returns a missing Data object for any MathType
 String prettyString(int indent)
           
 MathType unary(int op, Vector names)
           
 
Methods inherited from class visad.MathType
addTimeAlias, findScalarType, guessMaps, main, prettyString, stringToType, toString
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 

Constructor Detail

TupleType

public TupleType(MathType[] types)
          throws VisADException
array of component types

Throws:
VisADException
Method Detail

getDimension

public int getDimension()
get number of components


getComponents

public MathType[] getComponents()
get array of components


getRealComponents

public RealType[] getRealComponents()

getNumberOfRealComponents

public int getNumberOfRealComponents()

__getitem__

public MathType __getitem__(int index)
                     throws VisADException
A wrapper around getComponent for JPython.

Returns:
The requested Data object.
Throws:
VisADException

__len__

public int __len__()
A wrapper around getComponents for JPython.

Returns:
The number of components of this TupleType

getComponent

public MathType getComponent(int i)
                      throws VisADException
return component for i between 0 and getDimension() - 1

Throws:
VisADException

getIndex

public int getIndex(String name)
return index of first RealType component with name; if no such component, return -1


getIndex

public int getIndex(MathType type)
return index of first component with type; if no such component, return -1


equals

public boolean equals(Object type)
Description copied from class: MathType
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

Specified by:
equals in class MathType

hashCode

public int hashCode()
Overrides:
hashCode in class Object

equalsExceptName

public boolean equalsExceptName(MathType type)
Description copied from class: MathType
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

Specified by:
equalsExceptName in class MathType

equalsExceptNameButUnits

public boolean equalsExceptNameButUnits(MathType type)
Specified by:
equalsExceptNameButUnits in class MathType

cloneDerivative

public MathType cloneDerivative(RealType d_partial)
                         throws VisADException
Specified by:
cloneDerivative in class MathType
Throws:
VisADException

binary

public MathType binary(MathType type,
                       int op,
                       Vector names)
                throws VisADException
Specified by:
binary in class MathType
Throws:
VisADException

unary

public MathType unary(int op,
                      Vector names)
               throws VisADException
Specified by:
unary in class MathType
Throws:
VisADException

getFlat

public boolean getFlat()
Is this a "flat" tuple?

Returns:
true if all components are RealType or RealTupleType.

prettyString

public String prettyString(int indent)
Specified by:
prettyString in class MathType

missingData

public Data missingData()
Description copied from class: MathType
returns a missing Data object for any MathType

Specified by:
missingData in class MathType

buildShadowType

public ShadowType buildShadowType(DataDisplayLink link,
                                  ShadowType parent)
                           throws VisADException,
                                  RemoteException
Specified by:
buildShadowType in class MathType
Throws:
VisADException
RemoteException