visad.data.dods
Class Adapter

java.lang.Object
  extended by visad.data.dods.Adapter
Direct Known Subclasses:
AttributeAdapter, VariableAdapter, VectorAdapter

public abstract class Adapter
extends Object

Provides support for adapting DODS objects to the VisAD data-import context.

Instances are immutable.

Author:
Steven R. Emmerson

Constructor Summary
Adapter()
           
 
Method Summary
protected static dods.dap.AttributeTable attributeTable(dods.dap.DAS das, dods.dap.BaseType baseType)
          Returns the attribute table corresponding to a DODS variable.
protected static dods.dap.AttributeTable attributeTable(dods.dap.DAS das, String name)
          Returns the attribute table corresponding to a name.
protected  CacheStrategy getCacheStrategy()
          Returns the FileFlatField cacheing strategy for DODS adapters.
protected static boolean isFlat(MathType mathType)
          Indicates if a given VisAD MathType is "flat" (i.e. comprises a Real, a RealTuple, or a Tuple of Reals and RealTuples.
protected static MathType mathType(MathType[] mathTypes)
          Returns the VisAD MathType corresponding to an array of MathTypes.
protected static RealType realType(dods.dap.BaseType variable, dods.dap.AttributeTable table)
          Returns the VisAD RealType corresponding to a DODS variable.
protected static RealType realType(dods.dap.BaseType variable, dods.dap.DAS das)
          Returns the VisAD RealType corresponding to a DODS variable.
protected static RealType realType(String name, dods.dap.AttributeTable table)
          Returns the VisAD RealType corresponding to a name.
protected static RealType realType(String name, dods.dap.DAS das)
          Returns the VisAD RealType corresponding to a name.
protected static String scalarName(String name)
          Returns the VisAD scalar-name equivalent to a DODS name.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

Adapter

public Adapter()
Method Detail

scalarName

protected static String scalarName(String name)
Returns the VisAD scalar-name equivalent to a DODS name.

Parameters:
name - The DODS name.
Returns:
The VisAD scalar-name equivalent to the DODS name.
See Also:
ScalarType

isFlat

protected static boolean isFlat(MathType mathType)
Indicates if a given VisAD MathType is "flat" (i.e. comprises a Real, a RealTuple, or a Tuple of Reals and RealTuples.

Parameters:
mathType - The VisAD mathtype to be investigated.
Returns:
true if and only if the given mathtype is "flat".

realType

protected static RealType realType(dods.dap.BaseType variable,
                                   dods.dap.DAS das)
Returns the VisAD RealType corresponding to a DODS variable.

Parameters:
variable - The DODS variable. Must be one for which a RealType is possible.
das - The DODS DAS in which the attribute table for the DODS variable is embedded.
Returns:
The VisAD RealType corresponding to the variable and attribute table.

realType

protected static RealType realType(dods.dap.BaseType variable,
                                   dods.dap.AttributeTable table)
Returns the VisAD RealType corresponding to a DODS variable.

Parameters:
variable - The DODS variable. Must be one for which a RealType is possible.
table - The DODS attribute table for the variable. May be null.
Returns:
The VisAD RealType corresponding to the variable and attribute table.

realType

protected static RealType realType(String name,
                                   dods.dap.DAS das)
Returns the VisAD RealType corresponding to a name.

Parameters:
name - The name.
das - The DODS DAS in which the information on the name is embedded.
Returns:
The VisAD RealType corresponding to the name and metadata.

realType

protected static RealType realType(String name,
                                   dods.dap.AttributeTable table)
Returns the VisAD RealType corresponding to a name.

Parameters:
name - The name.
table - The DODS attribute table for the name. May be null.
Returns:
The VisAD RealType corresponding to the name and attribute table.

attributeTable

protected static dods.dap.AttributeTable attributeTable(dods.dap.DAS das,
                                                        dods.dap.BaseType baseType)
Returns the attribute table corresponding to a DODS variable.

Parameters:
das - The DODS DAS in which the attribute table for the DODS variable is embedded.
baseType - The type of the sub-component. May not be null.
Returns:
The attribute table corresponding to the variable. Will be null if no such table exists.

attributeTable

protected static dods.dap.AttributeTable attributeTable(dods.dap.DAS das,
                                                        String name)
Returns the attribute table corresponding to a name.

Parameters:
das - The DODS DAS in which information on the name is embedded.
name - The name to lookup in the DAS.
Returns:
The attribute table corresponding to the name. Will be null if no such table exists.

mathType

protected static MathType mathType(MathType[] mathTypes)
                            throws VisADException
Returns the VisAD MathType corresponding to an array of MathTypes.

Parameters:
mathTypes - The array of mathTypes.
Returns:
The MathType of the input aggregate. Will be null if the array has zero length. Will be the first element of a one-element array. Will be either a RealTuple or a Tuple -- as appropriate -- for a multi-element array.
Throws:
VisADException - VisAD failure.

getCacheStrategy

protected CacheStrategy getCacheStrategy()
Returns the FileFlatField cacheing strategy for DODS adapters. This may be used by DODS adapters during the creation of FileFlatField-s.

Returns:
The FileFlatField cacheing strategy.