visad.data.netcdf
Class NetCDF

java.lang.Object
  extended by visad.data.FormNode
      extended by visad.data.Form
          extended by visad.data.netcdf.NetCDF
All Implemented Interfaces:
FormFileInformer
Direct Known Subclasses:
Plain

public abstract class NetCDF
extends Form
implements FormFileInformer

The NetCDF class provides an abstract class for the family of netCDF data forms for files in a local directory.


Field Summary
 
Fields inherited from class visad.data.Form
mathType
 
Constructor Summary
NetCDF(String name)
          Construct a netCDF data form.
 
Method Summary
 String[] getDefaultSuffixes()
          Returns the path-component suffixes that identifies a dataset specification as being a netCDF dataset specification.
 boolean isThisType(byte[] block)
          Indicates if a given block of bytes is the start of a netCDF dataset.
 boolean isThisType(String spec)
          Indicates if a dataset specification is consistent with a netCDF dataset specification.
abstract  DataImpl open(String path)
          Open an existing file.
 
Methods inherited from class visad.data.Form
getMathType
 
Methods inherited from class visad.data.FormNode
add, getForms, getName, open, save
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

NetCDF

public NetCDF(String name)
Construct a netCDF data form.

Parameters:
name - The name for the family of netCDF data forms.
Method Detail

open

public abstract DataImpl open(String path)
                       throws BadFormException,
                              IOException,
                              VisADException
Open an existing file.

Specified by:
open in class FormNode
Parameters:
path - The pathname of the file.
Throws:
BadFormException - netCDF couldn't handle VisAD object.
VisADException - Couldn't create necessary VisAD object.
IOException - I/O error.

isThisType

public boolean isThisType(String spec)
Indicates if a dataset specification is consistent with a netCDF dataset specification.

Specified by:
isThisType in interface FormFileInformer
Parameters:
spec - A dataset specification. NB: Not a URL.
Returns:
true if and only if the dataset specification is consistent with a netCDF dataset specification.

isThisType

public boolean isThisType(byte[] block)
Indicates if a given block of bytes is the start of a netCDF dataset.

Specified by:
isThisType in interface FormFileInformer
Parameters:
block - A block of data.
Returns:
True if and only if the given block of bytes is the start of a netCDF dataset.

getDefaultSuffixes

public String[] getDefaultSuffixes()
Returns the path-component suffixes that identifies a dataset specification as being a netCDF dataset specification. The suffixes don't have a leading period. The returned array can be safely modified.

Specified by:
getDefaultSuffixes in interface FormFileInformer
Returns:
A freshly-allocated array with the relevant suffixes.