## visad.data.dods
Class VectorAdapter

    java.lang.Object
      visad.data.dods.Adapter
          visad.data.dods.VectorAdapter

Direct Known Subclasses:
  BaseTypeVectorAdapter, NumericVectorAdapter

public abstract class VectorAdapter
extends Adapter

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

Instances are immutable.

Constructor Summary
`protected` `VectorAdapter(PrimitiveVector vector, DAS das, VariableAdapterFactory factory)` Constructs from a DODS vector and a factory for creating DODS variable adapters.

Method Summary
`MathType` `getMathType()` Returns the VisAD math-type of this instance.
`SimpleSet[]` `getRepresentationalSets(boolean copy)` Returns the VisAD `Set`s that will be used to represent this instance's data values in the range of a VisAD `FlatField`.
`protected VariableAdapter` `getVariableAdapter()` Returns the adapter of the DODS variable that underlies this instance.
`GriddedSet` `griddedSet(PrimitiveVector vector)` Throws a `VisADException`.
`boolean` `isFlat()` Indicates whether or not the VisAD `MathType` of this instance is "flat".
`void` `setField(BaseTypePrimitiveVector vector, FieldImpl field, boolean copy)` Throws a `VisADException`.
`void` `setField(BooleanPrimitiveVector vector, FieldImpl field, boolean copy)` Throws a `VisADException`.
`void` `setField(BytePrimitiveVector vector, FieldImpl field, boolean copy)` Throws a `VisADException`.
`void` `setField(Float32PrimitiveVector vector, FieldImpl field, boolean copy)` Throws a `VisADException`.
`void` `setField(Float64PrimitiveVector vector, FieldImpl field, boolean copy)` Throws a `VisADException`.
`void` `setField(Int16PrimitiveVector vector, FieldImpl field, boolean copy)` Throws a `VisADException`.
`void` `setField(Int32PrimitiveVector vector, FieldImpl field, boolean copy)` Throws a `VisADException`.
`void` `setField(PrimitiveVector vector, FieldImpl field, boolean copy)` Sets the range of a compatible VisAD `Field`.
`void` `setField(UInt16PrimitiveVector vector, FieldImpl field, boolean copy)` Throws a `VisADException`.
`void` `setField(UInt32PrimitiveVector vector, FieldImpl field, boolean copy)` Throws a `VisADException`.

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

### VectorAdapter

    protected VectorAdapter(PrimitiveVector vector,
                            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

### getVariableAdapter

    protected final VariableAdapter getVariableAdapter()

  Returns the adapter of the DODS variable that underlies this instance.

  Returns:
    The adapter of the DODS variable that underlies this instance.

### getMathType

    public final MathType getMathType()

  Returns the VisAD math-type of this instance.

  Returns:
    The math-type this instance.

### isFlat

    public boolean isFlat()

  Indicates whether or not the VisAD `MathType` of this instance is "flat". A MathType is flat if it comprises a VisAD `RealType`, `RealTupleType`, or a `Tuple` of RealTypes and RealTupleTypes.

  Returns:
    `true` if and only if the MathType of this instance is "flat".

### getRepresentationalSets

    public final SimpleSet[] getRepresentationalSets(boolean copy)

  Returns the VisAD `Set`s that will be used to represent this instance's data values in the range of a VisAD `FlatField`.

  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 the returned array only under extreme duress.

### setField

    public void setField(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.

  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.

### setField

    public void setField(BooleanPrimitiveVector vector,
                         FieldImpl field,
                         boolean copy)
                  throws VisADException

  Throws a `VisADException`. Override this method in subclasses where appropriate.

  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` - The vector has the wrong DODS type.

### setField

    public void setField(BytePrimitiveVector vector,
                         FieldImpl field,
                         boolean copy)
                  throws VisADException

  Throws a `VisADException`. Override this method in subclasses where appropriate.

  Parameters:
    `vector` - A DODS primitive vector whose data values are to be used to set the range of the VisAD field.
    `copy` - If true, then the range values are copied from the primitive vector.
    `field` - A VisAD field to have its range values set.
  Throws:
    `VisADException` - The vector has the wrong DODS type.

### setField

    public void setField(UInt16PrimitiveVector vector,
                         FieldImpl field,
                         boolean copy)
                  throws VisADException

  Throws a `VisADException`. Override this method in subclasses where appropriate.

  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` - The vector has the wrong DODS type.

### setField

    public void setField(Int16PrimitiveVector vector,
                         FieldImpl field,
                         boolean copy)
                  throws VisADException

  Throws a `VisADException`. Override this method in subclasses where appropriate.

  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` - The vector has the wrong DODS type.

### setField

    public void setField(UInt32PrimitiveVector vector,
                         FieldImpl field,
                         boolean copy)
                  throws VisADException

  Throws a `VisADException`. Override this method in subclasses where appropriate.

  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` - The vector has the wrong DODS type.

### setField

    public void setField(Int32PrimitiveVector vector,
                         FieldImpl field,
                         boolean copy)
                  throws VisADException

  Throws a `VisADException`. Override this method in subclasses where appropriate.

  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` - The vector has the wrong DODS type.

### setField

    public void setField(Float32PrimitiveVector vector,
                         FieldImpl field,
                         boolean copy)
                  throws VisADException

  Throws a `VisADException`. Override this method in subclasses where appropriate.

  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` - The vector has the wrong DODS type.

### setField

    public void setField(Float64PrimitiveVector vector,
                         FieldImpl field,
                         boolean copy)
                  throws VisADException

  Throws a `VisADException`. Override this method in subclasses where appropriate.

  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` - The vector has the wrong DODS type.

### setField

    public void setField(BaseTypePrimitiveVector vector,
                         FieldImpl field,
                         boolean copy)
                  throws VisADException,
                         RemoteException

  Throws a `VisADException`. Override this method in subclasses where appropriate.

  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` - The vector has the wrong DODS type.
    `RemoteException` - Java RMI failure.

### griddedSet

    public GriddedSet griddedSet(PrimitiveVector vector)
                          throws VisADException,
                                 RemoteException

  Throws a `VisADException`. Override this method in subclasses where appropriate.

  Parameters:
    `vector` - A DODS primitive vector whose data values are to be used to set the range of the VisAD field.
  Throws:
    `VisADException` - The vector has the wrong DODS type.
    `RemoteException` - Java RMI failure.