visad.data.netcdf.out
Class RealAccessor

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

class RealAccessor
extends DataAccessor

The RealAccessor class accesses data in a VisAD Real that's been adapted to a netCDF API. It's useful for exporting data to a netCDF dataset.


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 RealAccessor(VisADAccessor outerAccessor)
          Construct from an outer accessor.
 
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

RealAccessor

protected RealAccessor(VisADAccessor outerAccessor)
Construct from an outer accessor.

Parameters:
outerAccessor - The DataAccessor for the encompassing VisAD data object. Returns VisAD Reals.
Method Detail

get

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

Specified by:
get in class DataAccessor
Returns:
The datum at the position given by localIndexes and outerIndexes.
Throws:
IOException - Data access I/O failure.

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.