visad.data.dods
Class FloatVectorAdapter

java.lang.Object
  extended by visad.data.dods.Adapter
      extended by visad.data.dods.VectorAdapter
          extended by visad.data.dods.NumericVectorAdapter
              extended by visad.data.dods.FloatVectorAdapter
Direct Known Subclasses:
BooleanVectorAdapter, ByteVectorAdapter, Float32VectorAdapter, Int16VectorAdapter, Int32VectorAdapter, UInt16VectorAdapter, UInt32VectorAdapter

public abstract class FloatVectorAdapter
extends NumericVectorAdapter

Provides support for adapting DODS floating-point vectors to the VisAD data-import context.

Instances are immutable.

Author:
Steven R. Emmerson

Constructor Summary
protected FloatVectorAdapter(dods.dap.PrimitiveVector vector, dods.dap.DAS das, VariableAdapterFactory factory)
          Constructs from a DODS vector and a factory for creating DODS variable adapters.
 
Method Summary
protected abstract  float[] getFloats(dods.dap.PrimitiveVector vector, boolean copy)
          Returns the numeric values of a compatible DODS primitive vector.
 GriddedSet griddedSet(dods.dap.PrimitiveVector vector)
          Returns the VisAD GriddedSet corresponding to the metadata of the DODS primitive vector used during construction of this instance and the data values of a compatible DODS primitive vector.
 void setField(dods.dap.PrimitiveVector vector, FieldImpl field, boolean copy)
          Sets the range of a compatible VisAD Field.
 
Methods inherited from class visad.data.dods.VectorAdapter
getMathType, getRepresentationalSets, getVariableAdapter, isFlat, setField, setField, setField, setField, setField, setField, setField, setField, setField
 
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
 

Constructor Detail

FloatVectorAdapter

protected FloatVectorAdapter(dods.dap.PrimitiveVector vector,
                             dods.dap.DAS das,
                             VariableAdapterFactory factory)
                      throws BadFormException,
                             VisADException,
                             RemoteException
Constructs from a DODS vector and a factory for creating DODS variable adapters.

Parameters:
vector - A DODS vector to be adapted.
das - The DODS DAS in which the attribute table for the DODS vector is embedded.
factory - A factory for creating adapters of DODS variables.
Throws:
BadFormException - The DODS information is corrupt.
VisADException - VisAD failure.
RemoteException - Java RMI failure.
Method Detail

setField

public final void setField(dods.dap.PrimitiveVector vector,
                           FieldImpl field,
                           boolean copy)
                    throws VisADException,
                           RemoteException
Sets the range of a compatible VisAD Field. The range values are taken from a DODS primitive vector whose metadata must be compatible with the metadata of the primitive vector used during construction of this instance.

Specified by:
setField in class NumericVectorAdapter
Parameters:
vector - A DODS primitive vector whose data values are to be used to set the range of the VisAD field.
field - A VisAD field to have its range values set.
copy - If true, then the range values are copied from the primitive vector.
Throws:
VisADException - VisAD failure.
RemoteException - Java RMI failure.

griddedSet

public GriddedSet griddedSet(dods.dap.PrimitiveVector vector)
                      throws VisADException,
                             RemoteException
Returns the VisAD GriddedSet corresponding to the metadata of the DODS primitive vector used during construction of this instance and the data values of a compatible DODS primitive vector.

Specified by:
griddedSet in class NumericVectorAdapter
Parameters:
vector - A DODS primitive vector whose metadata is compatible with the metadata of the primitive vector used in construting this instance.
Returns:
A VisAD GriddedSet corresponding to the input. The (super)class of the object is Gridded1DSet.
Throws:
VisADException - VisAD failure.
RemoteException - Java RMI failure.

getFloats

protected abstract float[] getFloats(dods.dap.PrimitiveVector vector,
                                     boolean copy)
Returns the numeric values of a compatible DODS primitive vector.

Parameters:
vector - A DODS primitive vector that is compatible with the primitive vector used to construct this instance.
copy - If true, then a copy is returned.
Returns:
The numeric values of the primitive vector.