visad.data.dods
Class SequenceVariableAdapter

java.lang.Object
  extended by visad.data.dods.Adapter
      extended by visad.data.dods.VariableAdapter
          extended by visad.data.dods.SequenceVariableAdapter

public class SequenceVariableAdapter
extends VariableAdapter

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

Instances are immutable.

Author:
Steven R. Emmerson

Nested Class Summary
protected  class SequenceVariableAdapter.SequenceAccessor
          Provides support for accessing a DODS DSequence as a VisAD FileFlatField.
 
Method Summary
 DataImpl data(dods.dap.DSequence sequence, boolean copy)
          Returns the VisAD DataImpl corresponding to a DODS DSequence.
 MathType getMathType()
          Returns the VisAD MathType of this instance.
 SimpleSet[] getRepresentationalSets(boolean copy)
          Returns the VisAD Sets that will be used to represent this instances data values in the range of a VisAD FlatField.
static SequenceVariableAdapter sequenceVariableAdapter(dods.dap.DSequence sequence, dods.dap.DAS das, VariableAdapterFactory factory)
          Returns an instance of this class corresponding to a DODS DSequence.
protected  void setField(dods.dap.DSequence sequence, FieldImpl field, boolean copy)
          Sets the range of a compatible VisAD FieldImpl from a DODS DSequence.
 
Methods inherited from class visad.data.dods.VariableAdapter
data, data, data, data, data, data, data, data, data, data, data, data, data, data, mathType
 
Methods inherited from class visad.data.dods.Adapter
attributeTable, attributeTable, getCacheStrategy, isFlat, mathType, realType, realType, realType, realType, scalarName
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

sequenceVariableAdapter

public static SequenceVariableAdapter sequenceVariableAdapter(dods.dap.DSequence sequence,
                                                              dods.dap.DAS das,
                                                              VariableAdapterFactory factory)
                                                       throws VisADException,
                                                              RemoteException
Returns an instance of this class corresponding to a DODS DSequence.

Parameters:
sequence - The DODS variable. Only the DODS metadata is used: the variable needn't have any actual data.
das - The DODS DAS in which the attribute table for the DODS variable is embedded.
factory - A factory for creating variable adapters.
Returns:
An instance of this class corresponding to the input arguments.
Throws:
VisADException - VisAD failure.
RemoteException - Java RMI failure.

getMathType

public MathType getMathType()
Returns the VisAD MathType of this instance.

Specified by:
getMathType in class VariableAdapter
Returns:
The MathType of this instance.

getRepresentationalSets

public SimpleSet[] getRepresentationalSets(boolean copy)
Returns the VisAD Sets that will be used to represent this instances data values in the range of a VisAD FlatField.

Overrides:
getRepresentationalSets in class VariableAdapter
Parameters:
copy - If true, then the array is cloned.
Returns:
The VisAD Sets used to represent the data values in the range of a FlatField. WARNING: Modify only under duress.

data

public DataImpl data(dods.dap.DSequence sequence,
                     boolean copy)
              throws VisADException,
                     RemoteException
Returns the VisAD DataImpl corresponding to a DODS DSequence.

Overrides:
data in class VariableAdapter
Parameters:
sequence - The DODS variable to have the corresponding VisAD data object returned. The variable must be compatible with the variable used to construct this instance.
copy - If true, then data values are copied.
Returns:
The VisAD data object of this instance. The class of the object will be FileFlatField, FlatField, or FieldImpl.
Throws:
VisADException - VisAD failure. Possibly the variable wasn't compatible with the variable used to construct this instance.
RemoteException - Java RMI failure.

setField

protected void setField(dods.dap.DSequence sequence,
                        FieldImpl field,
                        boolean copy)
                 throws VisADException,
                        RemoteException
Sets the range of a compatible VisAD FieldImpl from a DODS DSequence.

Parameters:
sequence - A DODS variable whose data values will be used to set the VisAD Field.
field - A VisAD field whose range values will be set. The field must be compatible with the DODS sequence.
copy - If true, then data values are copied.
Throws:
VisADException - VisAD failure. Possibly the DODS variable and the VisAD field are incompatible.
RemoteException - Java RMI failure.