visad.data.netcdf.out
Class VisADAdapter

java.lang.Object
  extended by ucar.netcdf.AbstractNetcdf
      extended by visad.data.netcdf.out.VisADAdapter
All Implemented Interfaces:
ucar.netcdf.Netcdf

public class VisADAdapter
extends ucar.netcdf.AbstractNetcdf

The VisADAdapter class adapts a VisAD data object to the AbstractNetcdf API.


Constructor Summary
VisADAdapter(Data data)
          Construct from a generic VisAD data object.
 
Method Summary
protected  ucar.netcdf.Dimension define1DDim(SampledSet set)
          Define the netCDF dimension of a 1-D SampledSet.
protected  ucar.netcdf.Dimension[] defineLinearSetDims(GriddedSet set)
          Define the netCDF dimensions of a VisAD LinearSet, including any necessary coordinate variables..
protected  ucar.netcdf.Dimension defineNDDim(SampledSet set)
          Define the netCDF dimension of a multi-dimensional SampledSet.
protected  ucar.netcdf.Dimension defineSampledSetDim(SampledSet set)
          Define the netCDF dimensions and variables of a VisAD SampledSet.
 ucar.multiarray.Accessor ioFactory(ucar.netcdf.ProtoVariable protoVar)
          Return a MultiArray Accessor for a variable.
protected  ucar.netcdf.Dimension[] reverse(ucar.netcdf.Dimension[] inDims)
          Reverse the dimensions in a 1-D array.
protected  void visit(Data data, visad.data.netcdf.out.VisADAccessor outerAccessor)
          Visit a VisAD data object.
protected  void visit(Field field, visad.data.netcdf.out.VisADAccessor outerAccessor)
          Define the netCDF dimensions and variables of a VisAD Field object.
protected  void visit(Real real, visad.data.netcdf.out.VisADAccessor outerAccessor)
          Visit a VisAD Real object.
protected  void visit(Text text, visad.data.netcdf.out.VisADAccessor outerAccessor)
          Visit a VisAD Text object.
protected  void visit(Tuple tuple, visad.data.netcdf.out.VisADAccessor outerAccessor)
          Visit a VisAD Tuple object.
 
Methods inherited from class ucar.netcdf.AbstractNetcdf
add, contains, contains, get, getAttribute, getAttributes, getDimensions, initHashtable, iterator, putAttribute, putDimension, size, toCdl, toString
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

VisADAdapter

public VisADAdapter(Data data)
             throws BadFormException,
                    VisADException,
                    RemoteException,
                    IOException
Construct from a generic VisAD data object.

Parameters:
data - The VisAD data object to be adapted to a netCDF API
Throws:
UnimplementedException - Something that should be implemented isn't yet.
BadFormException - The VisAD data object cannot be adapted to a netCDF API
VisADException - Problem in core VisAD. Some VisAD object probably couldn't be created.
RemoteException - Remote data access failure.
IOException - Data access failure.
Method Detail

visit

protected void visit(Data data,
                     visad.data.netcdf.out.VisADAccessor outerAccessor)
              throws UnimplementedException,
                     BadFormException,
                     VisADException,
                     RemoteException,
                     IOException
Visit a VisAD data object.

Parameters:
data - The VisAD data object to be visited.
outerAccessor - The means for accessing the individual VisAD data objects of the enclosing VisAD data object.
Throws:
UnimplementedException - Something that should be implemented isn't yet.
BadFormException - The VisAD data object cannot be adapted to a netCDF API
VisADException - Problem in core VisAD. Probably some VisAD object couldn't be created.
RemoteException - Remote data access failure.
IOException - Data access failure.

visit

protected void visit(Text text,
                     visad.data.netcdf.out.VisADAccessor outerAccessor)
              throws BadFormException,
                     IOException
Visit a VisAD Text object.

Parameters:
text - The VisAD Text object to be visited.
outerAccessor - The means for accessing the individual VisAD Text objects of the enclosing VisAD data object.
Throws:
BadFormException - The VisAD data object cannot be adapted to a netCDF API
IOException - Data access failure.

visit

protected void visit(Real real,
                     visad.data.netcdf.out.VisADAccessor outerAccessor)
              throws BadFormException,
                     VisADException
Visit a VisAD Real object.

Parameters:
real - The VisAD Real object to be visited.
outerAccessor - The means for accessing the individual VisAD Real objects of the enclosing VisAD data object.
Throws:
BadFormException - The VisAD data object cannot be adapted to a netCDF API
VisADException - Problem in core VisAD. Probably some VisAD object couldn't be created.

visit

protected void visit(Tuple tuple,
                     visad.data.netcdf.out.VisADAccessor outerAccessor)
              throws VisADException,
                     RemoteException,
                     IOException
Visit a VisAD Tuple object.

Parameters:
tuple - The VisAD Tuple object to be visited.
outerAccessor - The means for accessing the individual VisAD Tuple objects of the enclosing VisAD data object.
Throws:
VisADException - Problem in core VisAD. Probably some VisAD object couldn't be created.
RemoteException - Remote data access failure.
IOException - Local data access failure.

visit

protected void visit(Field field,
                     visad.data.netcdf.out.VisADAccessor outerAccessor)
              throws RemoteException,
                     VisADException,
                     BadFormException,
                     UnimplementedException,
                     IOException
Define the netCDF dimensions and variables of a VisAD Field object.

Parameters:
field - The VisAD Field to be visited
outerAccessor - The means for accessing the individual VisAD Field objects of the enclosing VisAD data object.
Throws:
UnimplementedException - Something that should be implemented isn't yet.
BadFormException - The VisAD data object cannot be adapted to a netCDF API
VisADException - Problem in core VisAD. Probably some VisAD object couldn't be created.
RemoteException - Remote data access failure.
IOException - Local data access failure.

defineLinearSetDims

protected ucar.netcdf.Dimension[] defineLinearSetDims(GriddedSet set)
                                               throws VisADException,
                                                      BadFormException
Define the netCDF dimensions of a VisAD LinearSet, including any necessary coordinate variables..

Parameters:
set - The VisAD GriddedSet to be examined, WHERE set instanceof LinearSet.
Returns:
The netCDF dimensions of set.
Throws:
VisADException
BadFormException

defineSampledSetDim

protected ucar.netcdf.Dimension defineSampledSetDim(SampledSet set)
                                             throws VisADException,
                                                    BadFormException
Define the netCDF dimensions and variables of a VisAD SampledSet.

Parameters:
set - The VisAD SampledSet to be examined.
Returns:
The netCDF dimension of set.
Throws:
VisADException - Problem in core VisAD.
BadFormException - set cannot be represented in a netCDF dataset.

define1DDim

protected ucar.netcdf.Dimension define1DDim(SampledSet set)
                                     throws VisADException,
                                            BadFormException
Define the netCDF dimension of a 1-D SampledSet. This dimension will have an associated, netCDF coordinate variable.

Parameters:
set - The set to have a netCDF dimension defined for it. Precondition: set.getDimension() == 1.
Returns:
The netCDF dimension corresponding to the 1-D SampledSet.
Throws:
VisADException - Problem in core VisAD.
BadFormException - set cannot be represented in a netCDF dataset.

defineNDDim

protected ucar.netcdf.Dimension defineNDDim(SampledSet set)
                                     throws VisADException,
                                            BadFormException
Define the netCDF dimension of a multi-dimensional SampledSet. This will be an "index" dimension with associated netCDF variables that represent the independent coordinates of the domain set.

Parameters:
set - The VisAD SampledSet to be examined and have a corresponding netCDF "index" dimension created together with netCDF variables for the independent variables. Precondition: set.getDimension() > 1.
Returns:
The netCDF dimension corresponding to the SampledSet.
Throws:
VisADException - Problem in core VisAD.
BadFormException - set cannot be represented in a netCDF dataset.

reverse

protected ucar.netcdf.Dimension[] reverse(ucar.netcdf.Dimension[] inDims)
Reverse the dimensions in a 1-D array.


ioFactory

public ucar.multiarray.Accessor ioFactory(ucar.netcdf.ProtoVariable protoVar)
Return a MultiArray Accessor for a variable. This method is part of the AbstractNetcdf class and should never be called -- so it always throws an error.

Specified by:
ioFactory in class ucar.netcdf.AbstractNetcdf