visad.data.netcdf.out
Class FieldAccessor

java.lang.Object
  extended byvisad.data.netcdf.out.DataAccessor
      extended byvisad.data.netcdf.out.FieldAccessor
All Implemented Interfaces:
VisADAccessor

class FieldAccessor
extends DataAccessor

The FieldAccessor class accesses data in a VisAD Field that's being adapted to a netCDF API.


Field Summary
protected  Dimension[] localDims
          The netCDF Dimensions of the VisAD data object in netCDF order (outermost dimension first).
protected  int[] localIndexes
          The netCDF indexes for the local VisAD data object in netCDF order (outermost dimension first).
protected  int localRank
          The number of netCDF dimensions in the VisAD data object.
protected  VisADAccessor outerAccessor
          The VisADAccessor of the outer VisAD data object.
protected  int[] outerIndexes
          The netCDF indexes for the outer VisAD data object in netCDF order (outermost dimension first).
protected  int outerRank
          The number of netCDF dimensions in the outer VisAD data object.
 
Constructor Summary
protected FieldAccessor(Dimension[] localDims, VisADAccessor outerAccessor)
          Construct from netCDF Dimensions, and an outer VisADAccessor.
 
Method Summary
protected  Object get()
          Return a datum given the split, netCDF indexes.
 Object get(int[] indexes)
          Return a datum given its location as netCDF indexes.
 Dimension[] getDimensions()
          Return the netCDF dimensions at the level of the data object.
 int[] getLengths()
          Return the netCDF dimensional lengths.
 int getRank()
          Return the number of netCDF dimensions at the current level.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

localRank

protected final int localRank
The number of netCDF dimensions in the VisAD data object.


localDims

protected final Dimension[] localDims
The netCDF Dimensions of the VisAD data object in netCDF order (outermost dimension first).


localIndexes

protected volatile int[] localIndexes
The netCDF indexes for the local VisAD data object in netCDF order (outermost dimension first).


outerAccessor

protected final VisADAccessor outerAccessor
The VisADAccessor of the outer VisAD data object.


outerRank

protected final int outerRank
The number of netCDF dimensions in the outer VisAD data object.


outerIndexes

protected volatile int[] outerIndexes
The netCDF indexes for the outer VisAD data object in netCDF order (outermost dimension first).

Constructor Detail

FieldAccessor

protected FieldAccessor(Dimension[] localDims,
                        VisADAccessor outerAccessor)
Construct from netCDF Dimensions, and an outer VisADAccessor.

Parameters:
localDims - The netCDF dimensions of the Field in netCDF. order (outermost dimension first).
outerAccessor - The DataAccessor for accessing the Fields object of the enclosing, VisAD data object.
Method Detail

get

protected Object get()
              throws IOException
Return a datum given the split, netCDF indexes.

Specified by:
get in class DataAccessor
Returns:
The Object at the position specified by localIndexes and outerIndexes.
Throws:
IOException - The corresponding datum couldn't be accessed.

getRank

public int getRank()
Return the number of netCDF dimensions at the current level.

Specified by:
getRank in interface VisADAccessor
Returns:
The netCDF rank (i.e. the number of netCDF dimensions) of the VisAD data object being adapted. Includes the dimensions of all enclosing VisAD data objects.

getDimensions

public Dimension[] getDimensions()
Return the netCDF dimensions at the level of the data object. Include all dimensions in more outer data objects.

Specified by:
getDimensions in interface VisADAccessor
Returns:
The array of netCDF Dimensions of the VisAD data object being adapted. Includes the dimensions of all enclosing VisAD data objects.

getLengths

public int[] getLengths()
Return the netCDF dimensional lengths.

Specified by:
getLengths in interface VisADAccessor
Returns:
The lengths of the netCDF Dimensions of the VisAD data object being adapted. Includes the dimensions of all enclosing VisAD data objects.

get

public Object get(int[] indexes)
           throws IOException
Return a datum given its location as netCDF indexes.

Specified by:
get in interface VisADAccessor
Parameters:
indexes - The netCDF indexes for the datum.
Returns:
The VisAD data object (e.g. Tuple) or Java primitive (e.g. Double) corresponding to the given position.
Throws:
IOException - The corresponding datum couldn't be accessed.